r/FlutterDev • • 5h ago

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

8 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 • • 7h 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 • • 1h 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 • • 1h ago

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

1 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 • • 7h 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 • • 6h ago

Article I built a desktop git client in Flutter for Windows, macOS and Linux. Here's what desktop Flutter too

1 Upvotes

Branchi is an open-source (MIT) git client. The UI is Flutter desktop, and

git runs in a Rust library called through dart:ffi.

Things that might interest Flutter devs:

- **Desktop-first UX:** tabs restored on restart, window_manager, keyboard

shortcuts (Ctrl/⌘+1–4 for sections, Alt+F12 for the terminal), right-click

menus, light/dark themes and accent colors.

- **Built-in terminal:** `xterm` + `flutter_pty`. I had to vendor flutter_pty

and patch a Windows bug where the shell got its own path as its first

argument, which broke PowerShell.

- **Code editor:** `re_editor` + `re_highlight`.

- **Full RTL:** English, Persian and Arabic with a mirrored layout, plus a

Jalali calendar. [One sentence on what was hardest about RTL.]

- **dart:ffi to Rust:** a plain C API that returns JSON, with no codegen.

GIF tour, install for all three OSes and the source:

https://github.com/mbpcoder/Branchi

Happy to answer questions about Flutter on desktop. UI feedback is very

welcome.


r/FlutterDev • • 8h ago

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

0 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 • • 22h ago

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

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

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

Thumbnail flutterverse.org
3 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 • • 1d 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 • • 1d 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 • • 1d 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 • • 1d 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 • • 1d 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 • • 2d 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 • • 1d 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 • • 2d 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 • • 2d ago

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

15 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 • • 2d 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


r/FlutterDev • • 2d ago

Plugin DevPul, an open-source browser UI for a running Flutter debug build (HTTP, errors, logs, mocks)

1 Upvotes

I got tired of the print, hot reload, scroll the console loop when an API call breaks, so I built DevPul. It's mine, it's free and open source, and I'd like feedback.

It shows what a running Dart or Flutter debug build is doing, in a browser tab or as a tab in DevTools:

  • HTTP calls with headers and bodies, and copy one as curl
  • errors with the stack trace, the route, and the requests and logs right before it
  • mock a request to a 500, or pause it like a breakpoint, edit it and let it go
  • actions your app registers (Devpul.action), run from the UI
  • plugins for Riverpod, bloc, go_router, sqflite and more
  • the same data for coding agents over MCP

How it works: the app posts events with dart:developer postEvent, so it uses the VM service every debug run already has. The browser reads them over 127.0.0.1. No proxy, no server, nothing leaves your machine.

Setup is devpul plus devpul_dio or devpul_http and devpul_flutter, then open DevTools or run devpul run in place of flutter run.

Docs: https://devpul.saradgajurel.com.np

Source: https://github.com/ictsolved/devpul

Demo: https://www.youtube.com/watch?v=g58MdxxEVWo

Where it does not fit, so you don't waste time:

  • It does nothing in release builds.
  • It is not for performance, memory or layout. Use DevTools.
  • HTTP shows up through the Dio and package:http adapters, or on native through dart:io. On Flutter web, calls outside an adapter are not seen.

I'd like to know which part of your debugging loop is the most annoying, and what is missing for you to try this.


r/FlutterDev • • 2d ago

Plugin I built a seating plan editor and seat picker for Flutter

2 Upvotes

I built venue_seat_picker for Festapp Tickets, where we use it in production to let organizers lay out a venue and guests pick their seats. It's a pretty full-featured editor at this point. In the demo I Ctrl-drag a whole row of tables, chairs included. The package is MIT licensed, including for commercial use.

Watch the 32-second editor demo on YouTube

  • The Flutter editor runs on mobile, desktop and web. Drag in tables, custom shapes, curved rows and standing areas. Start from a blank plan or an editable template, and undo changes as you go.
  • Guests can zoom in, pick seats or choose how many standing tickets they want. The picker rolls back a selection if your backend rejects it.
  • The same JSON layout also works in a regular website with @festapp/venue-layout, a JavaScript SVG viewer and picker. Your app handles prices, live availability and seat holds.

Try it in your browser · pub.dev · GitHub (MIT) · npm


r/FlutterDev • • 2d ago

Article I built an offline-first sync queue in Flutter without sync packages. Here is what broke.

5 Upvotes

I wanted optimistic writes in a notes app: tap, see it immediately, let the network catch up. No sync package — just a queue, a tiny in-memory backend for development, and later a real API.

The queue is a list of intents, not API calls. Each operation stores: kind (create/update/delete), entity, entity id, payload, the base payload and base version it was written against, status, attempt count, next attempt time, and an idempotency key. Here is what it took to get right.

1. A timeout is not a failure.

My first version retried when a request timed out. Sometimes the server had already committed the write. Result: duplicate records, and in one case a duplicate invoice in a staging test.

The fix is a client-generated idempotency key per operation, sent as a header. The server stores the key with its result and replays that result when it sees the key again. Retry is now safe, including after a crash between "server committed" and "client saved the ack".

This is not optional or an edge case. A timeout after commit is normal behaviour on mobile networks.

2. Coalescing is only safe before the first attempt.

I merged queued edits for the same record to cut requests. Then I merged an edit into an operation that had already been sent once. Same key, new payload. The server either rejects it or, worse, stores something the user never wrote.

The queue now coalesces only when status == pending && attempts == 0. After any attempt, a new edit becomes a new operation with a new key. On create I merge edits into the create while it is still pending; once it is on the wire, the next edit is a separate update that waits for the create's server id.

3. Temp IDs live in more places than the row.

Offline creates get local_1. When the server answers with srv_42, the obvious step is to update the record's id. But other queued payloads still say local_1: parent ids, assignee ids, nested comment ids. The server rejects them or links the wrong thing.

The fix scans the queue and rewrites the id in entityId and recursively inside every payload map and list, then persists the mapping so old routes and old widgets still resolve. Order matters: rewrite before the next operation is sent, not after.

4. A failed head must block its own entity.

I tried skipping a failed operation and continuing with later writes for the same record. If an update fails and a delete succeeds, the server ends up in a state the user never saw.

Each entity is now a chain. Only the head is eligible. A failed or conflicted head blocks later writes for that entity and nothing else other entities keep syncing. The blocked head retries with jittered backoff, and when it needs a decision it waits for one.

What I stopped doing

  • Global FIFO. One slow record stopped everything; per-entity ordering is enough and much faster.
  • Retrying 400/422. A rejected payload will be rejected forever; it now goes straight to a dead-letter state.
  • Retrying into a 401. The queue pauses, keeps attempts, and waits for resumeWithAuth().
  • Mutating an operation after it was sent.
  • Showing a spinner for sync state. A chip ("3 waiting", "1 failed") plus a badge per row tells the user more in less space.

What I still find hard

Conflict UX. I have a field-by-field sheet now (merge / keep mine / keep theirs / discard), with server-wins, client-wins and field-merge policies for the automatic cases. But deciding which policy fits a screen is a product decision, not a technical one.

When an offline edit loses to a server change, how do you present it in Flutter without leaking the sync layer into every screen? I would genuinely like to see how other people structure that.

The queue, widgets and a demo app (with a fake backend, offline switch, latency, injected failures and a remote-edit button) are all part of one small package I put together after this experiment. Happy to answer questions about any of the four bugs; the code is small enough to read. The queue, the widgets and the demo app are also in a public repo — README, eight screenshots and the demo GIF: https://github.com/StephenColor/flutter-syncspool-kit


r/FlutterDev • • 2d ago

Article I wanted to play some songs but couldn't figure out the notes, so I built a local AI transcriber

1 Upvotes

I really wanted to play some mains but could not figure out the notes alone, then I found some services that uses AI to do it, but they were subscriptions, so I started building my own that runs locally.

https://github.com/boginni/music_transcriber

Still there is a bunch of things that could be improved, I am posting here for anyone that knows better than me how to improve transcription process....


r/FlutterDev • • 2d ago

Dart dewy - Create simple web apps with Dart

Thumbnail dewy.run
0 Upvotes

I created a simple web development environment for those learning to code. Code are compilation are all local and it can be installed as a PWA to be used offline.