r/FlutterDev • • 7h ago

Plugin I built the Flutter UI package I always wanted - Looks beautiful, adapts to any device, Liquid Glass on Apple devices. 100+ components & AI agent skills.

Thumbnail
serverpod.dev
38 Upvotes

r/FlutterDev • • 22h ago

Discussion How popular is Flutter in your country?

6 Upvotes

Is the usage of flutter increasing or decreasing in your country. is the usecase of AI shifting companies to use native, since ai can write both android and ios native codes. what is the situation in your country. In my country Nepal, flutter is moderately popular, many big apps are made using flutter few payment apps and few ride apps. what about you??


r/FlutterDev • • 1h ago

Article Three bugs a Flutter booking calendar only shows twice a year

2 Upvotes

I built a booking flow with no third-party packages — a pure-Dart slot engine, zone tables, a ChangeNotifier controller, widgets on top — and ran it at 320 dp with 3.0x text. The screens were fine from the start. The calendar was not. These three only show up once the calendar is real.

1. A generated "09:00" may not exist — and a skipped one can land after closing.

My first grid was generated in device time: for (t = open; t < close; t += step). On 29 March 2026 London jumps 01:00 -> 02:00, so an hourly grid from 00:00 to 06:00 produces six lines and five real start times. Nothing throws; the list just shows an hour that never happened.

Fix: generate the grid on a civil type with no zone (WallDate, WallTime), then convert each start once through a zone with real transitions:

WallTime wall = WallTime.at(date, minute);
DateTime start = zone.toInstant(wall);
bool shifted = false;
if (zone.isSkipped(wall)) {
  wall = zone.toWall(start);          // first minute that exists
  start = zone.toInstant(wall);
  shifted = true;
}
if (!seen.add(start)) continue;

Two things bite here. The moved 01:00 line becomes 02:00 local — the same instant as the real 02:00 line — so you need a set of seen instants or you ship two identical rows. And the moved line has to be re-checked against closing time. This one was a real defect found in review: open 00:00-02:30, a 60-minute session on a 15-minute grid, and the 01:30 line moves to 02:30 and ends at 03:30, half an hour after the door is locked. The generator now drops any slot whose wall end passes the range end.

Also don't do civil arithmetic on local DateTime: add minutes on DateTime.utc, or a phone set to a DST zone will "helpfully" add an hour to 23:00 + 60 min.

2. A 90-minute class is not always 90 minutes on the timeline.

Same class at 00:30 on 29 March ends at 02:00 on the wall clock, and at 01:00 UTC — 30 minutes of absolute time. On the October change the same 90 wall minutes are 150 minutes. If you store start + duration, the end is wrong on exactly those two days a year, and every conflict check built on it is wrong with it.

So compute the end on the wall clock (start.addMinutes(duration)) and convert it separately, and store both readings: startWall/endWall and start/end.

toInstant needs a stated policy too, not a library. A repeated hour (01:30 on 25 October) resolves to the earlier instant; a skipped hour (01:30 on 29 March) resolves to the first minute after the gap, i.e. 02:30 local, with a flag so the UI can say so. Mine takes the offsets from 26 hours before and after the reading and keeps the candidates that round-trip:

for (final offset in {before, after}) {
  final candidate = naive.subtract(Duration(minutes: offset));
  if (naive.difference(candidate).inMinutes == offsetMinutesAt(candidate)) valid.add(candidate);
}

That assumes at most one transition in that window — true for real DST, and a custom zone can implement offsetMinutesAt itself.

3. "Check, then write" double-books, and my buffer check was one-sided.

Two guests open the same 19:00 slot and tap 40 ms apart. Both pass the check before either writes, and one gets a booking the room doesn't have. The flow that fixed it is hold -> confirm: the hold takes the seats in one synchronous step and returns a typed rejection (full, duplicate, tooSoon), keeps them for a countdown, and confirm re-checks under the same rules before writing — the second guest gets a message instead of an overwritten row. Expiry puts dropped seats back on sale.

The buffer half: 60-minute treatment, 15-minute clean-down, 09:00 slot, booking at 10:05. My first version expanded existing bookings by their turnaround but not the candidate, so 09:00 stayed on sale even though the 09:00 session would still be cleaning up. Expand both sides. For multi-seat services there's one more rule: overlapping same-service bookings share the seat pool, a booking for a different service blocks the room, and a booking that only touches the turnaround (no session overlap at all) blocks the room rather than joining the pool — that last line is the one that took a review to get right.

Bonus, controller-level: confirmation sits behind a 520 ms spinner, and during that await the guest can tap another slot, so after the delay I check the hold id is still the one I started with. Loads use a generation counter and a disposed flag the same way; both have tests that dispose the controller mid-flight.

271 tests, with the two change days asserted as data — wall reading, instant, and round trip for every hour — rather than checked by eye.

Screens, README and a demo GIF are here if the layout is useful (no source in it): https://github.com/StephenColor/flutter-slotforge-kit


r/FlutterDev • • 17h ago

Article My girlfriend and I kept failing at keeping habits together, so I made something for us. Anyone want to help test it?

0 Upvotes

We'd been stuck on the same loop for months: "ok this week we're going to bed early", "tomorrow we're going for a run", "today I'm actually studying". Never happened. She'd text me asking if I'd had breakfast, I'd ask what time she was going to sleep, and it all just got lost in random texts. We tried habit apps but we each used them on our own and after like three days neither of us remembered they existed.

I'm a developer so I ended up making one for the two of us. It's called Bothly. Each of you checks off what you did that day (breakfast, going to bed early, getting up early, running, studying, whatever you want) and you can see if your partner already did theirs without having to ask. Some habits only count if you both do them, which builds a shared streak nobody wants to break lol. You can also send a photo of what you're up to or a little nudge when you see they're about to miss something. No ads.

The catch is Google won't let me publish it until 12 people test it for 14 days. If anyone's up for helping (with your partner or solo, either works):

Android only for now. If something breaks or feels off please tell me, honest feedback helps way more than "looks nice". Thanks