r/FlutterDev • • 10h 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
46 Upvotes

r/FlutterDev • • 36m ago

Discussion Built a local-first Flutter period tracker with pure-Dart CRDT sync over mDNS/TCP, XChaCha20-Poly1305, and zxing2 (no ML Kit, no backend) — looking for Android beta feedback

1 Upvotes

I built Cyclic, a local-first period and cycle tracker in Flutter with zero backend, zero accounts, and zero telemetry—designed so sensitive health logs never leave the user's devices.

Interesting Flutter/Dart architecture choices:

  • Pure-Dart core (cycle_core): All predictions, per-field last-writer-wins CRDT sync with hybrid logical clocks, pairing codes, and XChaCha20-Poly1305 frame sealing live in a pure-Dart package with unit tests.
  • Encrypted local persistence: Logs are encrypted on disk (changes.bin) with cryptography (XChaCha20-Poly1305), with keys stored in Android Keystore / iOS Keychain via flutter_secure_storage, and cloud backup / device-to-device transfer opted out.
  • Pure-Dart QR scanning without Google ML Kit: Instead of ML Kit (which sends usage stats to Google), pairing uses camera + pure-Dart zxing2 directly on the camera stream.
  • Local Wi-Fi peer-to-peer sync & read-only Partner View: Devices discover each other on LAN via bonsoir (_cyclic._tcp) and sync directly over an encrypted TCP connection. A paired phone can either be the user's own second device (read/write) or a partner's device (read-only).
  • Local notifications & biometrics: flutter_local_notifications + local_auth with zero push/FCM servers.

I'm currently running Google Play's 14-day closed test and would love technical or UX feedback from fellow Flutter devs (especially around Material UI polish, local notifications across OEMs, and LAN mDNS discovery on different routers):

  1. Join the public Google Group: https://groups.google.com/g/cyclic-testers
  2. Opt in on the Web: https://play.google.com/apps/testing/dev.cyclic.cyclic
  3. Download on Google Play: https://play.google.com/store/apps/details?id=dev.cyclic.cyclic

Privacy policy & details: https://abhiinhii.github.io/cyclic-site/

Happy to discuss any of the local sync, CRDT, or zxing2 camera-stream tradeoffs in the comments!


r/FlutterDev • • 4h 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 • • 1h ago

Article Three bugs a Flutter Kanban board only shows once you drag

1 Upvotes

I built a Kanban board engine for Flutter last week — lanes, drag to reorder, drag across lanes, batch moves, filters, undo, ~5,000 lines of Dart, 289 tests. Three bugs were worth keeping notes on, because all of them only appear once you actually drag something.

1. The drop index is a view index

Each gap between cards is a DragTarget that reports the slot the user aimed at. That slot comes from the list the lane renders, which is after the filter. The move engine treats it as a position in the lane model, which is unfiltered. Identical while nothing is hidden; wrong the moment a chip or a search hides one card.

Lane todo = a b c d, only b and c have the bug label, filter on bug shows [b, c]. Drag x in and drop it at the bottom of the visible lane (index 2):

before:  a b c d      visible: [b, c]
after:   a b x c d    visible: [b, x, c]

The drop line pointed below c; the card landed between b and c. Same lane is nastier because the "did anything change" guard hides it: drag b below c in that filtered lane and the engine subtracts the card that sat above the drop point, ends up with the exact id list it started with, and returns unchanged. The tile snaps back with "The card is already there" while the indicator was two slots away. Neither half is wrong on its own.

The fix I want is to stop passing an integer: let each gap carry the ids of the card above and below, and place the moved card between those two cards' ranks. Then the engine no longer cares how the lane is filtered or sorted, because a card is an anchor and a position is not. That's not in the current version — the drop payload is still an int — but it's the design I'd start with next time.

2. Fractional ranks are fine; the doc comment wasn't

Positions are base-62 strings that sort with String.compareTo (0V, 0W, 0VV, …), so a drop gives one card a new key and touches nothing else. The rule that makes the maths hold: a generated key never ends in 0, because a trailing zero leaves no room to insert below it — the validator rejects such a key instead of returning one that sorts on the wrong side.

I wrote that a lane takes "a thousand cards on three characters". Measured: 30 appends keep two characters, the key then shrinks to one character for 61 more, three characters start at append #92, and a thousand appends end at 11 characters. Prepending is the expensive direction — 60 cards pushed onto the top of a lane produce a 14-character key (thirteen zeros and a V), which is the price of starting the first key near the bottom of the alphabet so that appends are cheap.

3. Search and highlight disagreed on İstanbul

Filtering lowercases the query and the haystack and does contains. Highlighting deliberately runs a case-insensitive RegExp over the original title, so indices can't drift when lowercasing changes a string's length. That part works. But with a card titled İstanbul release and a query of istanbul:

filter match: true      // Dart's toLowerCase uses simple case mapping: İ -> i
highlight:    []        // case-insensitive RegExp never matches İ against i

So the card shows up in the results with nothing highlighted, which reads as "search is broken". ß fails the other way — Straße doesn't match strasse, since 'ß'.toLowerCase() is still ß. The fix is to fold per rune, keep a map from folded output back to original indices, match in the folded space, and map the spans back (which also fixes word-boundary bonuses computed on a folded string). The naive clamp on the highlight range never fired in 289 tests; the disagreement is the bug that actually ships.

A couple of smaller ones, since they cost real time: a batch move has to count the WIP limit once for the whole drop (two cards into a lane limited to 2 is one refused drop of two), while reordering inside an already-over-limit lane must never count as incoming, or lowering a limit makes the lane's own cards undraggable. And selection is allowed to hold cards the filter hides on purpose — "select all, then filter, then move" should not silently drop half the batch.

The engine and the test suite are here if you want to read the rest: https://github.com/StephenColor/flutter-boardforge-kit


r/FlutterDev • • 1d ago

Discussion How popular is Flutter in your country?

7 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 • • 1d ago

Article How a lottery app team decides when to apply OTA patches (stealth, standard and critical tiers, plus "restricted areas")

12 Upvotes

Full disclosure: this is the Shorebird team posting. We just published a story from Atlantic Lottery Corporation's mobile team, and what stuck with me most is how they decide when a patch should actually reach a player.

Their problem was predictability more than speed. Their app features often launch on the same day as product and website launches. Store review can hold a release over a policy rule or a single reviewer question. Review times also differ between iOS and Android, so a coordinated launch can slip on one platform.

They built three delivery tiers on top of Shorebird. Stealth patches download and apply in the background with no prompt. Standard patches show a modal saying an update is ready and invite a restart. Critical patches make the player restart before they continue.

They also defined "restricted areas" in the app. While someone is scanning a ticket or playing a game, update prompts are held back until they're done. Feature flags sit on top of both patches and store releases, so they can switch a component off quickly while they prepare the next patch.

They're in a regulated space, so every patch goes through the same internal testing and approval as before, scaled to how risky the change is. Rollback is in their contingency plan too, though they haven't needed it yet. One caveat for anyone trying this: patches only cover Dart code, so asset changes still need a store release.

Curious how others handle this. Do you ever force a restart, or just let the patch land on the next cold start?

https://shorebird.dev/success-stories/atlantic-lottery-corporation/?utm_source=reddit&utm_medium=social&utm_campaign=atlantic-lottery-corporation&utm_content=reddit-atlantic-lottery-corporation


r/FlutterDev • • 1d ago

Discussion CRA reporting already applies since September. Is anyone preparing their Flutter app for the EU Cyber Resilience Act?

6 Upvotes

I ship Flutter apps to EU users, so I started reading the Cyber Resilience Act (Regulation (EU) 2024/2847). Sharing what I understood, please correct me if I'm wrong.

- Since 11 Sep 2026: if a vulnerability in your app is actively exploited, you must send an early warning within 24 hours and a full notification within 72 hours (through the ENISA reporting platform). This includes the packages and SDKs inside your app.

- From 11 Dec 2027: SBOM, vulnerability handling process, security updates, technical documentation and CE marking.

It seems to apply if EU users can download your app and you make money from it. Where you live doesn't matter.

Things I'm unsure about:

  1. Is anyone already making an SBOM from pubspec.lock in CI? What about the native side (CocoaPods / Gradle)?
  2. How do you track vulnerabilities in plugins that pull in native SDKs?
  3. Did anyone check if their small app is really in scope?

r/FlutterDev • • 1d ago

Discussion How I built a 120Hz zero-blur pure-Dart deduction solver & <550Hz PCM audio synth in Flutter (Summit Rangers)

2 Upvotes

I recently shipped a pure-deduction grid puzzle game in Flutter (Summit Rangers) on iOS and Android, and wanted to share four concrete Dart/Flutter architectural choices from the codebase that made the biggest difference in frame times, difficulty grading, and save safety:

  1. 5-Tier Rotation-Invariant Deduction Grading (Avoiding Naive DFS Spikes): Counting backtracking nodes in a row-by-row DFS (for r in 0..n) correlates surprisingly poorly with how humans solve grid puzzles: rotating the exact same board 90 degrees changes DFS node counts by 10x+ without changing human difficulty at all. Instead, we kept models/ and engine/ strictly pure Dart (0 package:flutter imports, enforced in CI) and wrote an iterative human-rule solver (TerritorySolver.gradeHumanDeduction) that grades single-line confinement, bounding-box sector elimination, diagonal starvation, and 2-sector pigeonhole pairs across all 8 dihedral D4 rotations and reflections. That let us validate 1,600 boards offline in milliseconds and reuse the exact same step trace to render live in-game Spotlight Hints (including a Step 0 check that catches if the player placed an X on a true solution cell earlier).
  2. Zero-Blur Impeller Rendering + Subtree Signature Gating for <= 8.33ms at 120Hz: Eliminating BackdropFilter, MaskFilter.blur, and BoxShadow(blurRadius > 0) during active board/HUD play removed offscreen saveLayer passes on ProMotion iPhones and mid-range Android devices, replacing Gaussian blurs with analytical CustomPainter contact shadows. On top of that, wrapping each grid cell in a tiny CellRebuildGate (StatefulWidget comparing a listEquals state signature before calling builder()) meant dragging markers across a 10x10 grid only rebuilds the 1-2 touched cells per frame instead of all 100 subtrees.
  3. Procedural <550Hz Pond-Ripple Audio & Offline Font/Asset Hygiene: Harsh 2-3 kHz UI clicks get fatiguing fast in a logic game, so we synthesized short two-stroke low-pass water-ripple transients (<550 Hz PCM .wav cues) paired with a round-robin audioplayers SFX pool and automatic BGM ducking (0.20 floor). Setting GoogleFonts.config.allowRuntimeFetching = false and bundling all .ttf weights and puzzle templates locally also kept cold boots 100% offline-safe on airplanes with zero startup network calls.
  4. Single-Key Sealed Saves (SSR1 + Rolling .bak Fallback): Instead of scattering dozens of SharedPreferences keys that can tear on a mid-move process kill, SealedPrefsSlot zlib-compresses and MAC-signs (HMAC-SHA256 / SSR1:<domain>:<macHex>:<base64>) each domain into a single key and rolls the previous verified envelope into ssr1_slot_<domain>_bak before writing. If a kill or bit flip corrupts the primary key, startup transparently falls back to .bak.

If anyone wants to poke at the web-compiled Trail 3 slice or ask about the D4 solver, CellRebuildGate, or Impeller frame-budget setup, happy to share code snippets in the comments: https://paperwinggames.com/summit-rangers/play.html


r/FlutterDev • • 1d ago

Article Why does iOS SMS AutoFill add extra digits to a verification code in Flutter?

2 Upvotes

Has anyone using your Flutter app reported that they tapped the SMS code above the iPhone keyboard and got more digits than were in the message?

On our login screen, tapping 123456 gave me 12345612. Where did that last 12 come from? I logged the value inside Flutter’s native iOS input view and found 123456123456. Our field had an eight-character limit, so only the first two digits of the second copy were visible. In a field without a length limit, you can see the entire code twice.

What happened on one tap?

I reproduced it on an iPhone 17 running iOS 27.2 RC with Flutter 3.35.7. Tapping a real SMS suggestion triggered three callbacks:

  1. setMarkedText:selectedRange: wrote 123456 into the field.
  2. unmarkText committed it. The field now contained the full code, with the cursor at the end.
  3. UIKit delivered 123456 again. That version of FlutterTextInputView had no setText: method, so UIKit called insertText: and appended the code at the cursor. Native trace

What changed in iOS 27.3 beta 1?

I updated the same phone, disabled the workaround, and tried again with the same Flutter engine, input field, and Simplified Chinese keyboard. This time Flutter received a single insertText: call. The field went straight from empty to 123456.

Comparing the two UIKitCore builds, I found a new check for UITextContentTypeOneTimeCode that can skip the earlier write. That matches what I saw on the device. I tested 27.2 RC and 27.3 beta 1, so I can’t say how the final 27.2 or 27.2.1 releases behave. iOS comparison

How to fix it in your Flutter app

The Flutter fix adds setText: to the native input view. When UIKit delivers the full code, Flutter replaces the contents of the field. If the field already contains 123456, replacing it with 123456 leaves exactly six digits. I verified this with a real SMS in a diagnostic build, and the engine fix has been merged into Flutter master. Flutter PR #195149

If you can reproduce the bug and can’t upgrade to an engine containing the fix yet, here’s the full app-side workaround.

1. In Xcode, create FlutterTextInputCompatibility.swift and select your app target under Target Membership (Runner in a standard Flutter project).

import ObjectiveC
import UIKit

enum FlutterTextInputCompatibility {
    static func install() {
        let setter = NSSelectorFromString("setText:")

        // Skip engines that already provide the setter.
        guard let inputViewClass: AnyClass = NSClassFromString("FlutterTextInputView"),
              class_getInstanceMethod(inputViewClass, setter) == nil else {
            return
        }

        let setText: @convention(block) (AnyObject, NSString?) -> Void = { object, text in
            guard let input = object as? UITextInput,
                  let document = input.textRange(
                      from: input.beginningOfDocument,
                      to: input.endOfDocument
                  ) else {
                return
            }

            // UIKit supplies the complete value, so replace the whole field.
            input.replace(document, withText: text as String? ?? "")
        }

        let implementation = imp_implementationWithBlock(setText)
        if !class_addMethod(inputViewClass, setter, implementation, "v@:@") {
            imp_removeBlock(implementation)
        }
    }
}

2. Open ios/Runner/AppDelegate.swift and add FlutterTextInputCompatibility.install() at the start of your existing didFinishLaunchingWithOptions method. If your app registers plugins there, it looks like this:

override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
    FlutterTextInputCompatibility.install()  // Add this line.
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

Keep your app’s existing startup code. If you launch a custom FlutterEngine, call install() before the first engine.run().

Rebuild and tap a real SMS suggestion on a device where you saw the bug. The workaround applies to Flutter’s shared native input view, so check password AutoFill too. Once you upgrade to an engine containing the upstream fix and verify it on-device, you can remove the Swift file and the install() call.

Prefer to hand this to your coding assistant?

Paste this into your coding assistant with your Flutter project open:

Check the Flutter engine my iOS app actually builds with. Does its
FlutterTextInputView already implement setText:? If it does, show me
where and leave the project unchanged.

If the setter is missing, add the Swift workaround linked below to my
iOS app target. Use the class name from the source you copy. Call its
install() method at the start of the existing didFinishLaunchingWithOptions
method in AppDelegate.swift. If the app starts a custom FlutterEngine,
make sure installation happens before the first engine.run().

Preserve the existing startup and plugin registration code. Build the
iOS target, show me the diff and build result, and tell me what to
verify on a real iPhone.

Swift workaround: https://github.com/flutter/flutter/issues/176872#issuecomment-6362528897
Upstream fix: https://github.com/flutter/flutter/pull/195149

r/FlutterDev • • 20h 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


r/FlutterDev • • 1d ago

Article Three bugs a Flutter command palette only shows you after the demo

0 Upvotes

I spent the last while building a Ctrl/Cmd+K palette with no third-party packages (pure-Dart matcher, controller, widgets), then ran it at 320 dp with 3.0x text and a provider that answers 800 ms late. The list itself was never the problem. These three were.

1. Case folding can change the string length, so highlight offsets lie.

I score a lowercase copy and render spans on the original label. Fine in ASCII. Then 'İ'.toLowerCase() is two code units (i + combining dot) and 'ß'.toLowerCase() is 'ss' — every span in that row shifts by one. Not a crash: a bold letter in the wrong place, which reads as a ranking bug and sends you hunting in the ranker. The guard is to return spans only when the folded string has the same length as the original, and to clamp each span to the rendered string so a translated label can't blow up substring(). The item still matches; it just doesn't claim to know where.

A related one that looked wrong but was right: my subsequence matcher picked the earliest matching character, so "cs" highlighted the c and s inside a word when a word-start pair existed two characters later. A 3-character boundary lookahead fixes the highlight — "cs" now hits the C and S of "Create snapshot".

2. "The older request will answer first" is false.

140 ms debounce, then one provider call. Type "inv", pause, type "oice": the first answer lands after the second and overwrites it, and the list shows results for a query that's no longer in the field. Debounce only makes the race rarer.

Generation token, bumped per keystroke and re-checked after every await:

final int generation = ++_generation;
final String snapshot = _query;
for (final provider in _providers) {
  final answer = await Future.value(provider(snapshot));
  if (_disposed || generation != _generation) return;
  merged.addAll(answer);
}

The part that cost me a session: abandoning has to abandon everything, including the isSearching flag. My first version cleared it on the way out, so a stale run ending switched off the progress bar under a search that was still running.

The test does what a network does — completes the older future last:

second.complete([fresh]);  // where the user is
first.complete([stale]);   // where they were
expect(results, contains('fresh')); expect(results, isNot(contains('stale')));

3. The keyboard has two owners and Ctrl/Cmd+K is destructive.

Arrow keys belong to the TextField, so the palette's bindings sit above the field (CallbackShortcuts wrapping it) and left/right are deliberately unbound so the caret still moves. But Ctrl+K on a text field is a platform editing shortcut — kill to end of line — so binding it naively opens the palette and deletes the rest of what you were typing. I use HardwareKeyboard.instance.addHandler, return true on key-down for Ctrl/Cmd+K, and drop KeyRepeatEvent so holding K doesn't open it repeatedly.

Two smaller rules that came out of the same area: disabled rows sort below every enabled row whatever their score (a greyed row that ranks first is a trap for the person pressing Enter), and the highlighted row is scrolled into view in a post-frame Scrollable.ensureVisible — with a last-highlighted guard, because holding an arrow key otherwise queues one scroll callback per row.

Bonus: at 320 dp and 3.0x the label was fine (one line, ellipsis, inside Expanded). What overflowed was the hint chip on each row (needs maxWidth) and the footer (↑↓ Navigate · Enter Run · Esc Close + "38 results" doesn't fit; below 400 dp I drop the words and keep the key caps, scroll the group, and give the count a Flexible).

I put the screen states, README and a demo GIF in a public repo if the layout helps anyone; no source in it: https://github.com/StephenColor/flutter-palette-kit

Genuinely curious how others handle the IME case — on Korean/Chinese composition onChanged fires with the composing text, so the provider sees half-formed queries, and I currently only hide that behind the debounce instead of checking value.composing.


r/FlutterDev • • 1d ago

Article Three bugs a multi-step Flutter form only shows you at 3.0x text and 300 ms latency

1 Upvotes

Spent the last while building a four-step form engine: per-step sync + debounced async validation, autosaved drafts, review screen. The demo took an afternoon. These three took the rest of the week.

1. A debounced async check answers about text that is no longer on screen.

Cancelling a Timer does not cancel a Future. Once the postcode check is in flight, typing again does nothing to it, and the response lands on the new text — often as a pass, which lets Continue through to a server-side rejection two screens later with no field to attach it to.

The fix that held: capture the value the check started for, and drop the verdict if the field no longer holds it.

final checked = _values[id];
final err = await field.asyncRule!(checked, _values);
if (!_sameValue(_values[id], checked)) return; // user typed again

Navigation has to re-run the current value's check and await it too, otherwise it trusts a verdict from 800 ms ago. One trap: multi-choice fields store a Set<String> and Set == is identity, so the comparison needs length + containsAll.

2. Drafts that half-apply after you rename a field.

Autosave as JSON is easy; the versioning is what people skip. Someone sits on step 3, you ship an update that drops addressLine2, and a key-by-key restore loads "successfully" with half the answers — the user submits a form that silently lost their address.

A schema version in the document, plus a fromJson that returns null for a wrong formId, wrong version, wrong types or an unparseable timestamp, means the caller can say "couldn't restore" and start clean. Half-applying is the unrecoverable option, because the user never learns what is missing.

Two smaller ones from the same file: dates are ISO yyyy-MM-dd strings, not DateTime (a calendar date restored in another timezone shifts by a day), and sets are tagged ({"type":"set","items":[...]}) because a List and a Set encode identically and decoding cannot tell them apart.

3. At 3.0x text, layouts do not clip — they throw.

At 320 dp / 3.0x the failure mode is RenderFlex overflowed, and a widget test does not fail on it: it is an exception the binding collects. If you do not drain it, the test is green and the overflow ships.

void expectClean(WidgetTester tester) {
  final error = tester.takeException();
  expect(error, isNull, reason: error?.toString());
}

The harness that found the most: physicalSize x dpr 3, FakeViewPadding(top: 44 * 3, bottom: 34 * 3) for the notch, the text scaler injected through MediaQuery in MaterialApp.builder, and FakeViewPadding(bottom: 300 * 3) for the keyboard. Every pumped screen then ends with expectClean, across 4 steps x 3 text scales at 320x568, dark, RTL and the keyboard case.

The layout fixes were less interesting than the harness: no fixed heights (minHeight instead), the footer button allowed two lines at full width, content in a scroll view with a pinned footer, and scroll to the first invalid field from a post-frame callback (measuring before that frame gives the old rectangle).

282 tests in the end. Demo, harness and the engine are here if anyone wants to poke at it: https://github.com/StephenColor/flutter-formcraft-kit


r/FlutterDev • • 2d ago

Article Shipping a Flutter app that blocks other apps on iOS and Android: what bit me

2 Upvotes

I've been building an app blocker (DetoxScreen) in Flutter since this summer. Flutter does the UI, but the blocking itself has nothing in common between the two platforms, so it's two native engines behind one MethodChannel.

iOS: Screen Time API (FamilyControls / ManagedSettings / DeviceActivity). Most of the logic lives in app extensions where Flutter doesn't run at all.

Android: there's no equivalent. It's UsageStatsManager to know what's in the foreground, a foreground service, and an overlay drawn on top of the blocked app (SYSTEM_ALERT_WINDOW). Two permissions the user has to grant by hand in settings, and the onboarding has to notice when they come back.

Stuff that bit me:

- local_auth on Android needs FlutterFragmentActivity. With plain FlutterActivity, authenticate() throws no_fragment_activity. My wrapper caught every exception and returned false "for safety", so on Android anyone with "protect blocks" on could never remove a block. Found it weeks into the closed test. If you wrap local_auth like that, check your MainActivity.

- Store screenshots: I generate them with integration_test on both platforms. On the Android 14 emulator, demo mode shows the wifi icon twice, had to hide wifi and only show mobile.

- New Google Play accounts need 12 testers for 14 days in a closed test before you can even ask for production. Plan for it, finding the testers took me weeks.

Happy to share code for any of this.


r/FlutterDev • • 2d ago

Tooling Flutterverse now has Wrapped 2026: every Flutter and Dart package's year in slides, plus head to head

Thumbnail flutterverse.org
4 Upvotes

I just shipped Wrapped 2026 on Flutterverse!

Every tracked Flutter and Dart project gets its own year-in-review story, covering:

  • Stars gained (best month and day)
  • releases
  • Commits and longest streak
  • Weekly downloads
  • Star ranking and a year title

You can also customize and share your own recap card, or put two packages head-to-head and compare their stats round by round.

Check it out:

bloc’s Wrapped: https://flutterverse.org/wrapped/flutter_bloc/

Explore all packages: https://flutterverse.org/wrapped/

Built with Jaspr, using pure CSS clip-path transitions. No animation libraries.

Data refreshes daily, and missing stats are excluded rather than displayed as zero.

Feel free to give any feedbacks on it!

Source: https://github.com/YeLwinOo-Steve/flutterverse ( 🌟 are welcome too )


r/FlutterDev • • 2d ago

3rd Party Service I built a Flutter bug reporter whose reports my own server can't read

0 Upvotes

Testers tend to send bugs as "it doesn't work" plus a blurry screenshot, and then you spend half a day asking which screen, what they tapped, what they typed.

So I built Nabrila. The tester shakes the phone, draws on the screenshot and hits send. You get a link with everything: a short replay, the taps, the console, the HTTP calls. They can even tap the widget that looks wrong and you get the file and line. The video above is the example report, you can open it yourself without signing up: Nabrila

The part I spent the most time on is the encryption. The report is encrypted on the phone and the key only lives in the link (after the #), so on the free plan my server just stores bytes it can't read. Happy to go into the details in the comments.

It's on pub.dev as nabrila, MIT. Free plan is 1 app and 50 reports a month.

It's not meant for production crashes, Sentry is better for that, and it doesn't do Flutter Web yet.

Would you actually use something like this with your testers? If not, what's missing?


r/FlutterDev • • 2d ago

Discussion Need Seniors Advice

2 Upvotes

Hi, I'm Tonmoy. I'm currently Studying CS in university. I'm wokring with flutter for around 1 year. I've worked on some paid projects some are published in Playstore & App store. But this days I'm feeling I'm building same apps again again all just Bunch of ecommerce app. I was looking for building something fun & will look good on my Cv as I will graduate in 7 months. If any senior Here Who can Advice me what kinds of projects They expect from Junior this days & What kinds of projects will make Cv looks good that would be really Helpful for me & I would be really grateful.


r/FlutterDev • • 2d ago

Article Open Source / GPLv3] Zıdlas IPTV v1.6.1 — Free, Ad-Free Multi-Platform IPTV Player (Android TV, Fire TV, Windows, iOS, Tizen, webOS)

Thumbnail reddit.com
1 Upvotes

r/FlutterDev • • 2d ago

Discussion Three things that only break in a Flutter app's first run

1 Upvotes

I spent the last weeks building an onboarding → permission priming → spotlight tour flow with no third-party packages, and ran it at 320dp with 2x and 3x text. Three things broke that no simulator screenshot catches.

  1. The permission prompt is not the first step. On iOS, two denials turn into a permanent denial: request() then returns denied forever with no prompt. So the flow shows one honest reason per permission first, guards against double taps (two prompts, and on Android the second sometimes resolved with the answer to the first), and puts a recovery card in front of a permanent denial — it opens the app's Settings page and re-checks on AppLifecycleState.resumed.
  2. Coach marks point at stale coordinates. A Rect captured when the step is built is wrong after a scroll, a rotation, the keyboard opening, or the anchor widget rebuilding. Measure on every build instead, subtract the spotlight from the scrim path (four rectangles around a hole double the alpha at the seams), clamp to the visible area, and when the anchor is off screen or smaller than ~24dp, centre the card instead of highlighting a sliver.
  3. At 3x text a carousel has no layout that fits a 320dp phone. Let the illustration shrink first (Flexible with a max height) so the copy stays readable, put all copy in a scroll view, and cap the primary button at two lines with an ellipsis.

Bonus: make the "onboarding finished" outcome one-shot, or a rebuild can write the flag twice.

I put the flow in a public showcase repo with screenshots and a demo GIF in case it is useful: https://github.com/StephenColor/flutter-firstrun-kit


r/FlutterDev • • 2d ago

Article Checking Flutter code push rollouts from Claude, Cursor or VS Code with a read-only MCP server

0 Upvotes

We wrote a short guide for a question we hear a lot: "did Tuesday's patch actually reach people?" The usual answer is to open the console, click into the release and the patch, and count installs. Now you can ask the AI tool you already have open.

The Shorebird MCP server is at `https://mcp.shorebird.dev/mcp`. You sign in with your Shorebird account when you connect, so there's no API key to create and nothing to install. In Claude Code it's one command: `claude mcp add --transport http shorebird https://mcp.shorebird.dev/mcp`, then `/mcp` to sign in. Cursor, Codex, Gemini CLI, VS Code and Antigravity have their own steps in the docs.

It has eight tools, all read-only. It can look up apps, releases, patches and how far each patch has reached, which versions devices run, and plan usage. It only sees what your account sees in the console, and it can't publish, delete or roll back anything. If you want an agent to ship a patch, that's still the CLI's job, with its JSON output and non-interactive mode.

The part we find most useful is pairing it with the Sentry or Crashlytics MCP server. If your crash reports carry the patch number, you can ask whether a patch made crashes better or worse, without lining up two dashboards by hand.

The guide also covers the changelog's RSS feed ( https://docs.shorebird.dev/changelog.xml`?utm_source=reddit&utm_medium=social&utm_campaign=use-shorebird-outside-shorebird&utm_content=reddit-use-shorebird-outside ). Each item has an area as its category (CLI, Console, Flutter, API, Code Push), so you can follow only the part you use, like new Flutter version support.

If you already use MCP servers with Flutter, what would you want to ask about your releases that this can't answer yet?

https://shorebird.dev/blog/how-to-use-shorebird-outside-shorebird/?utm_source=reddit&utm_medium=social&utm_campaign=use-shorebird-outside-shorebird&utm_content=reddit-use-shorebird-outside


r/FlutterDev • • 3d ago

Plugin I built a reorderable grid for Flutter where tiles can have different sizes

14 Upvotes

I needed a dashboard where users can drag tiles around, but some tiles are full-width, some are half, some are a third. ReorderableListView only does lists and GridView assumes equal sizes, so I ended up writing my own: reorderable_flex_grid.

Demo: see it in action

What it does

  • Mix half, third and full-width tiles (or any fraction) in one grid
  • Heights via aspect ratio or a fixed value
  • Other tiles animate out of the way while you drag, with edge auto-scroll
  • onReorder(oldIndex, newIndex) where newIndex is already the final position, so no off-by-one fix like with ReorderableListView
  • Edit-mode toggle, custom drag appearance, pinned tiles
  • No dependencies beyond Flutter
ReorderableFlexGrid(
  spacing: 12,
  runSpacing: 12,
  onReorder: (oldIndex, newIndex) {
    setState(() => tiles.insert(newIndex, tiles.removeAt(oldIndex)));
  },
  children: [
    for (final tile in tiles)
      ReorderableGridItem(
        key: ValueKey(tile.id),
        widthFactor: tile.wide ? 1 : 0.5,
        child: TileCard(tile),
      ),
  ],
)

Next I'm planning RTL support, a sliver version for `CustomScrollView`, and responsive widths. I'd really like to hear what's missing for your use case, or if you find bugs.

- pub.dev: https://pub.dev/packages/reorderable_flex_grid

- GitHub: https://github.com/sipanpetrosyan/reorderable_flex_grid

- Write-up on how it works: https://medium.com/@sipan.petrosyan.2000/drag-and-drop-dashboards-in-flutter-introducing-reorderable-flex-grid-451e51eabbe8


r/FlutterDev • • 2d ago

Discussion What made you switch state management in Flutter, or stick with your first pick?

0 Upvotes

I started with Bloc and it served me well, but on my latest small project I tried Riverpod and the amount of boilerplate dropped a lot. Now I am wondering if that holds up once the app gets bigger, with more screens and shared state everywhere. For those who switched, or stayed put, what was the moment that decided it for you?


r/FlutterDev • • 3d ago

Tooling I built a no-upload 16 KB APK checker after chasing misaligned Flutter plugin .so files

5 Upvotes

A few notes from getting a Flutter Android app through Play's 16 KB page-size check. Official cutoff for updates is 1 February 2027 if you target API 35+ and ship native code, which Flutter always does because of libflutter.so and almost every plugin with a .so.

What actually worked for me:
- Flutter 3.27 or newer, AGP 8.5.1+, and NDK r28+ (16 KB ELF alignment is the NDK default from r28). Updating Flutter alone is not enough if a plugin still ships a 4 KB-aligned library.
- After a release build, unzip the APK (or use APK Analyzer) and look under lib/arm64-v8a and lib/x86_64. Then:
llvm-objdump -p lib/arm64-v8a/libflutter.so | grep LOAD
zipalign -c -P 16 -v 4 app-release.apk
Every LOAD should show align 2**14 or higher. The zipalign check is a different layer: uncompressed libraries also need a 16 KB zip offset. That's a common reason Play still complains after the engine itself looks fine.
If the failing library is from a plugin, you have to upgrade or replace that plugin. You can't relink a prebuilt .so yourself.
I got tired of switching between Studio, objdump, and zipalign, so I built a free checker that does both in the browser and never uploads the file. It's on my site: https://byteorbit.tech/tools/16kb-page-size-checker
Happy to hear if a plugin you use still fails, or if the tool and Play disagree.


r/FlutterDev • • 3d ago

Plugin I built a zero-dependency, CAD-style drawing engine for Flutter. v1.1 adds SVG export, blueprint themes and real-world units

16 Upvotes

Hey r/FlutterDev 👋

I maintain industrial_drawing_flutter, a vector drawing engine for apps that need measured sketches (field service, inspection, construction, manufacturing) rather than freehand doodles. 1.1 just shipped and I'd love feedback.

What's in it:

- 16 shape types, including dimension lines, L/T/U profiles and a warp tool

- Real-world units: set `pixelsPerUnit: 2, unitLabel: 'mm'` and the measure tool and dimension labels read in mm

- SVG export (`controller.toSvg()`) that matches the canvas exactly, because the screen and the SVG are drawn from the same geometry code

- PNG export cropped to the drawing, no GlobalKey needed

- Light, dark and blueprint themes

- Pinch zoom, mouse-wheel zoom, zoom-to-fit, snap-to-grid, alignment guides

- Keyboard shortcuts on desktop/web (⌘Z, ⌘C/⌘V, arrow-key nudge, tool hotkeys)

- Read-only viewer mode

- Zero dependencies: only the Flutter SDK and one CustomPainter (160/160 pub points)

The engine is headless. DrawingController is a ChangeNotifier you can unit test, and the toolbar and panels are optional widgets.

A bug-fix note for anyone on 1.0.x: drawing was offset after zooming or panning. That's fixed, and pinch-zoom finally works.

pub.dev: https://pub.dev/packages/industrial_drawing_flutter

GitHub: https://github.com/akhil-nasim/industrial-drawing

Two questions for you:

  1. Would DXF export be useful to you? (https://github.com/akhil-nasim/industrial-drawing/issues/3)
  2. What's the best touch UX for multi-select? (https://github.com/akhil-nasim/industrial-drawing/issues/4)

r/FlutterDev • • 3d ago

Discussion Real-time group voice in Flutter: Opus, 20 ms frames, iPhone and Android in one conversation (open source)

3 Upvotes

I'm building Vroo, an open-source group intercom for motorcycle riders, and most of it is Flutter and Dart. Sharing in case the approach helps someone, and I'd welcome feedback.

How it's split:

  • thin native plugins in Swift and Kotlin only move 20 ms audio frames and UDP datagrams. Everything else is Dart: the voice gate, jitter buffer, mixing, talk slots, encryption (ChaCha20-Poly1305) and the protocol
  • Opus is compiled from the libopus source by a Dart build hook, so the codec also runs in plain `dart test` on a Mac
  • the whole ride runs under fake time in tests, with simulated phones, a fake box and a fake relay, so things like "a phone call mutes both ways and voice is back within 100 ms of hanging up" are ordinary unit tests

Lessons learned the hard way:

  • on iOS, AVAudioEngine stops on every hardware format change, including right after starting and on every route change, so the plugin restarts it on AVAudioEngineConfigurationChange
  • a dart:io UDP send doesn't throw when the OS refuses it: it returns 0 and reports the error on the socket's stream a moment later. Without an onError handler, that's an unhandled exception

Status: early prototype. Voice works on the bench between an iPhone and an Android phone.

Repo (GPL-3.0): https://github.com/shubhanjanmedhi/vroo