Menu

The hour that doesn't exist: a DST-safe booking grid in Dart
πŸ“°

The hour that doesn't exist: a DST-safe booking grid in Dart

DEV Community: dartΒ·Stephen ColorΒ·about 8 hours ago
#JcmxZwTH
#devtodart#devto#dev#wall#booking
Long article (2162 words) β€” no AI summary yet.
Reading 0:00
15s threshold

A booking screen looks simple: a day, a list of times, a button. Mine worked in the demo for a week. Then I put a real calendar under it β€” opening hours with a lunch break, a 15-minute turnaround between treatments, two guests tapping the same 19:00 β€” and the demo turned out to be the only place it worked.

Flutter gives you DateTime , and DateTime has a time zone. What it does not tell you is that a wall time never happened, or that a duration measured on the clock on the wall is not the same as the duration between two instants. So the parts that decide whether a booking app is correct are: which clock the grid belongs to, what a stored booking actually is, and where the seat check happens.

I built this with no third-party packages β€” pure Dart for the engine and the zone tables, a ChangeNotifier controller, widgets on top β€” at 320 dp and 3.0Γ— text. These are the five decisions that took the rewrites.

1.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.