r/FlutterDev • • 11h ago

Tooling I built Raccoon, a tiny Flutter runtime: first run in 15 s instead of 5 min, no Xcode or Gradle

33 Upvotes

Hi r/FlutterDev šŸ‘‹ I'm Simon, I build Lumide, a Flutter IDE. I wanted the write, save, see loop to be faster, so I built Raccoon, a tiny Flutter runtime, and today I'm open-sourcing it, with Raccoon Simulator as a demo you can run today. can run today.

Try it with Raccoon Simulator

Open Raccoon Simulator, and Raccoon shows up in flutter devices. Pick it in Lumide, VS Code, Android Studio or a terminal and run as usual. Your app appears in the simulator window, with hot reload and hot restart from your editor. No project to open in it, no new workflow.

How it works

Raccoon is a small runner built on Flutter's C embedder API. flutter run -d raccoon builds a debug bundle from your host's own snapshots, the runner hosts it on a prebuilt engine, and the simulator draws its frames. So there's no Xcode, no Gradle and no native build. The first launch sets everything up for you: it builds the runner, downloads a 15 MB engine and registers the custom device.

What else it unlocks

  • Your whole app, not just previews. Flutter's widget previewer renders the functions you mark with @Preview. Raccoon runs your real app: routing, state, services and hot reload, at phone, tablet or desktop size.
  • Hot-loaded plugins with custom UI. A Flutter app can show another Flutter app inside it with raccoon_view. So an app can load plugins at runtime, each with its own custom UI, with no rebuild of the host app.

Numbers (Flutter Wonderous, flutter run to first frame, medians)

Target Clean build Warm run
Chrome 25.8 s 24.8 s
macOS desktop 46.4 s 17.7 s
Raccoon on macOS 15.0 s 7.5 s
Linux desktop 13.8 s 4.5 s
Raccoon on Linux 12.0 s 3.5 s

A first run against an Android emulator took 308 s from empty caches. Raccoon took 15.5 s. Hardware, versions and scripts to reproduce are in the README.

Limits, honestly

It's alpha. It speeds up the inner loop; it doesn't replace testing on a real device or in a browser.

  • Plugins: pure Dart ones, the clipboard and url_launcher. No text input yet.
  • Packages with native code or build hooks don't run on Raccoon yet.
  • Frames are software rendered.
  • macOS and Linux only for now.

r/FlutterDev • • 16h ago

Plugin I got tired of wiring up native UI in every Flutter app, so I made native_kit

16 Upvotes

I kept needing the same things across projects: a native action sheet, the iOS color picker with the eyedropper, a document scanner, the Android Photo Picker. Each time I’d end up adding another plugin or writing some Swift/Kotlin to get it working.

Eventually I put that work into a package. It’s calledĀ native_kit, and the idea is pretty simple: call it from Dart, get the native UI, await the result.

For example:

final choice = await NativeKit.showActionSheet(
  context: context,
  items: const [
    NativeMenuItem(
      id: 'share',
      title: 'Share',
      iosSymbol: 'square.and.arrow.up',
    ),
    NativeMenuItem(
      id: 'delete',
      title: 'Delete',
      style: NativeActionStyle.destructive,
    ),
  ],
);

That opens aĀ UIAlertControllerĀ on iOS, with a popover on iPad, or a Material 3 bottom sheet on Android.

There are 30 components so far. Besides the usual alerts and pickers, it covers things like document/barcode scanning, OCR, background removal, PencilKit markup, video trimming, biometrics, and system panels. The full list is in the README.

A few things I learned building it, for anyone doing similar platform work:

  • Dismissing UI is half the work.Ā The API lives in one Pigeon 29 file, which generatesĀ async throwsĀ Swift andĀ suspendKotlin. Bridging callbacks into that is straightforward until you account for every way someone can close a screen. Swipe down, back, predictive back, tap outside… all of those need to resolve the Dart Future exactly once. Cancellation returnsĀ null.
  • AvoidingĀ MainActivityĀ changes took some work.Ā I use a headless fragment for activity results, with a transparentĀ FragmentActivityĀ host when the app uses a plainĀ FlutterActivity. One bug we caught: Photo Picker / SAF URI grants disappear when that host finishes. You have to read the result before closing it.
  • iPad and theming have their own quirks.Ā The suppliedĀ BuildContextĀ gives me the popover anchor and the Flutter theme. On iOS 26, getting the Liquid Glass sheet chrome to follow that theme meant applying it at the presentation controller.
  • A successful build tells you surprisingly little here.Ā The example app has 47 XCUITests and 45 UI Automator tests that interact with the native screens. Those simulator/emulator runs turned up 21 bugs that compiled just fine.

There are limitations. VisionKit scanning, subject lifting, andĀ UIVideoEditorControllerĀ need a real device for successful results. Full contact details on Android needĀ READ_CONTACTS, though picking a single phone number, email, or address doesn’t. Android screen capture currently only returns the consent result.

Package: https://pub.dev/packages/native_kit
Source: https://github.com/leofilllium/flutter_native_kit

Curious what native UI you still find yourself writing platform code for. I’m collecting requests in the issues, but happy to hear them here too.


r/FlutterDev • • 6h ago

Plugin Textf 2.0 – formatted text with links in one string

3 Upvotes

Most Flutter apps have a sentence like this somewhere:

I agree to the Terms of Service and Privacy Policy.

Two links and some bold text. With plain Flutter, that usually turns into something like this:

class _ConsentTextState extends State<ConsentText> {
  late final _terms = TapGestureRecognizer()..onTap = () => open(termsUrl);
  late final _privacy = TapGestureRecognizer()..onTap = () => open(privacyUrl);

  @override
  void dispose() {
    _terms.dispose();
    _privacy.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Text.rich(
      TextSpan(children: [
        const TextSpan(text: 'I agree to the '),
        TextSpan(text: 'Terms of Service', style: linkStyle, recognizer: _terms),
        const TextSpan(text: ' and '),
        TextSpan(text: 'Privacy Policy', style: linkStyle, recognizer: _privacy),
        const TextSpan(text: '.'),
      ]),
    );
  }
}

The sentence is also split into five pieces, which makes it awkward to translate.

With pkg:textf it's one string:

Textf(
  'I agree to the [**Terms of Service**](https://example.com/terms) '
  'and [**Privacy Policy**](https://example.com/privacy).',
)

Tap handling goes through onLinkTap on a TextfOptions widget higher up in the tree, so you set it once. The sentence stays a single entry in your .arb file, and translators can see the formatting.

What Textf is

A drop-in replacement for Text that understands inline formatting: **bold**, *italic*, ~~strike~~, \code`,==highlight==,links, super/subscript. All the usualTextparameters still work (style,maxLines,overflow,textScaler`, …). It has zero dependencies.

Also for input: TextfEditingController

The same syntax works live inside a TextField:

final controller = TextfEditingController();

TextField(controller: controller)

It's a drop-in replacement for TextEditingController. Formatting renders as you type, the stored value stays plain text, and cursor positions match the raw text 1:1. IME composing (CJK etc.) works.

New in 2.0

  • Works with any design system. With Flutter decoupling Material and Cupertino, Textf now builds only on the widgets layer. It runs the same in Material, Cupertino, a custom design system or a bare WidgetsApp.
  • Headings and horizontal rules. # to ###### for headings, --- for a divider. That's useful for short things like release notes or onboarding cards.

To be clear about scope: Textf is still not a Markdown renderer. There are no lists, tables, images or block layout. If you're rendering whole documents, a full Markdown package is the better tool.


r/FlutterDev • • 10h ago

Plugin I built a country code picker with real phone number validation, 202 languages and a custom builder (country_code_selector)

6 Upvotes

Hi r/FlutterDev, I just published my second package 4 days ago and would love feedback.

The problem: every phone number field I've built needed a country picker, a flag set, a validation library, and glue code to make "0803…" and "803…" both work. I wanted one package that handles it properly.

What it does:

- 5 ready-made pickers: dialog, bottom sheet, Cupertino wheel, dropdown, and a compact flag + dial code button for phone fields

- customBuilder: build your own picker UI; you get the filtered countries, search, selection and the phone number length

- Real validation: isValidPhoneNumber() checks actual numbering ranges via libphonenumber data, and accepts local, trunk-prefixed or international input

- toE164(): normalizes whatever the user typed to +2348031234567

- pinUserCountry: puts the user's country (from their locale region) first

- Country names in 202 languages (238 locales), generated from Unicode CLDR

- RTL support, theming via ThemeExtension, search by name, ISO code or dial code

TextFormField(

decoration: InputDecoration(

prefixIcon: CountryCodeSelectorWidget(

pinUserCountry: true,

onChanged: (c) => setState(() => _country = c),

),

),

validator: (v) => _country.isValidPhoneNumber(v ?? '')

? null

: 'Enter a valid ${_country.name} number',

);

One thing I spent time on: libphonenumber's metadata adds about 2 MB to a release build. I restructured the package so that data only gets included if you actually call the validation functions. In my measurements, a picker-only app went from 24.4 MB to 22.2 MB.

Flutter 3.29+, MIT licensed, 160/160 pub points.

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

- GitHub: https://github.com/TheinvinciblePrints/country_code_selector

I'd especially appreciate feedback on the API design, and from native speakers on the picker's built-in text in their language. Issues and PRs are welcome.


r/FlutterDev • • 17h ago

Article Shipping a Flutter app in 2026 - the ultimate guide

Thumbnail
serverpod.dev
14 Upvotes

r/FlutterDev • • 15h ago

Discussion Best Production Approach for Force Update in Flutter Without Unnecessary API Calls

8 Upvotes

Hi everyone šŸ‘‹

I’m working on a Flutter app and want to discuss the best production approach for implementing a force-update feature.

How do you usually handle app version checks in production without making unnecessary API requests to the server?

For example, should we check the app version every time the app launches, use Firebase Remote Config, or maintain a cached version check?

I want to make sure the solution is efficient, avoids unnecessary server calls, and still forces users to update when required.

What approach are you using in your production apps, and what would you recommend? Would love to hear your thoughts and experiences! šŸš€


r/FlutterDev • • 8h ago

Discussion I shipped a puzzle game in Flutter: offline levels from Firestore, a Python level generator, and low-latency audio with SoLoud

2 Upvotes

I've been building Rillroot, a line puzzle game, in Flutter, and a few parts might be useful to others:

Levels: generated ahead of time by a Python script that checks each board has exactly one solution. They're stored as JSON packs of 100 levels, and a publish script writes a manifest with sha256 hashes and uploads everything to Firestore. The app ships a bundled base pack and caches downloads, so it plays fully offline. A Python Cloud Function generates and publishes the daily puzzles every week.

Audio: flutter_soloud at 48 kHz with a 512-sample buffer (2048 lagged noticeably). Every tile a root crosses plays a pluck one note higher up a pentatonic scale, and a fast drag plays at most the last 3 notes per frame so the sound never trails your finger.

State: Cubits for app-level state, while the board itself stays local and runs on a ticker.

Accounts: every player gets an anonymous Firebase account on first launch; signing in with Google links the same account so nothing is lost.

It's in closed beta on Android, so it takes three quick steps:

  1. Join the tester group: https://groups.google.com/g/rillroot-testers
  2. Opt in: https://play.google.com/apps/testing/com.dangasama.garden
  3. Install: https://play.google.com/store/apps/details?id=com.dangasama.garden

Use the same Google account that's on your phone. If the store page says "not found", wait a few minutes after joining.

Happy to go deeper on any of these.


r/FlutterDev • • 15h ago

Plugin DeepLinkNow finally has a Flutter SDK for deferred deep linking

3 Upvotes

Look, I'll be honest, one of the first requests I had after I built my deferred deep linking platform DeepLinkNow was a Flutter SDK.

I'm a react native dev by trade, and long story short 18 months later I've finally released it, along with a whole heap of quality of life improvements to DLN including:

  • A free tier with 25,000 MAU, no card required (Detour allows 1500, Branch/Appsflyer don't even have free tiers anymore etc)
  • Flutter SDK on pub.dev (deeplinknow), wrapping the native iOS and Android SDKs
  • Teams: workspaces, invites, roles
  • SSO (Entra, Okta, Google Workspace) on Enterprise
  • An MCP server, so Claude Code or Cursor can set it up for you
  • Clicks deleted after 30 days, no ad tracking or attribution
  • Custom domains

If you don't know what DeepLinkNow is: a (+-deferred) deep linking platform I built after getting so frustrated trying to integrate Branch.io and Appsflyer into my apps. It just does deferred deep linking. It's simple, it's useful, it does NO ad tracking or $$$ MMP stuff nor does it have AI embedded anywhere near it.

You send a user to a DLN page, we open your app and send you their intent. If they don't have your app installed, we hold onto the intent link until they install it. Then give it back to you.

Try it out and let me know how you go. If you're using Branch, AppsFlyer or are just floating in the darkness after Firebase Dynamic Links got shut down, give DLN a try, happy to offer to help you migrate.

P.S. I had a search through /r/flutterdev for issues people have had with deep linking on Flutter, and I've directly addressed everything in these two:

  1. https://www.reddit.com/r/FlutterDev/comments/1vjkz9c/ (iOS links breaking after the UIScene change)

  2. https://www.reddit.com/r/FlutterDev/comments/1vf4j64/ (six things that silently break deferred deep linking)

Flutter plugin link: https://pub.dev/packages/deeplinknow

Source: https://github.com/deeplinknow/dln-flutter

MCP server if you wanna hand off to AI to get you started: https://deeplinknow.com/docs/mcp


r/FlutterDev • • 11h ago

Article Build a Flutter Phone Dialer with Call History

Thumbnail
lautarolobo.xyz
1 Upvotes

r/FlutterDev • • 7h ago

Discussion how should a beginner actually learn Flutter today?

0 Upvotes

I'm a beginner with a decent understanding of how AI Agens work and coding fundamentals .

I have a few app ideas I want to build. I started a standard Flutter course a couple of months ago, paused, and now I'm stuck in a mental loop about how to actually learn in the current AI landscape.

I know I don't want to purely "vibe code" like millions of others right now, because blindly prompting without understanding what's happening under the hood doesn't build scalable, real products.

At the same time, I anticipate many of you will recommend the standard path: "Learn Flutter manually first, then use AI to speed up your workflow." And that is the exact loop I'm stuck in:

If the end goal is to let AI write the majority of the code anyway, what is the point of spending months grinding through manual syntax and boilerplat—especially when 10 new models will drop before I even finish a traditional course? Yet, it feels like the only way to truly understand app architecture and state management is by coding manually first, because no courses teach "architecture and code literacy" without forcing you through the traditional manual coding grind.

So for those of you building real apps: how do I break this loop? Is grinding through manual coding still the only way to build the mental model needed to direct AI, or is there a smarter way to learn Flutter architecture and debugging without wasting time on skills AI has already replaced?


r/FlutterDev • • 13h ago

Discussion [HELP NEEDED] I want to transition myself to IOS dev from Flutter

Thumbnail
1 Upvotes

r/FlutterDev • • 1d ago

Example I tested fscene.dev and created 3D dice

13 Upvotes

Finally, Flutter has real 3D support and while I'm not smart enough to understand all the 3D features mentioned in this video, I pointed Claude to the documentation and kindly asked for a 3D dice roller, which worked like a charm.

I had to painstakingly fix the dice geometry and digit placement, though. Claude was able to write a custom physics engine for rolling the dice without problems, but was at the same time unable to construct a d8 or d10 (and my d12 is still a little bit too large compared to the d20 now that I'm looking at it). A "pro" would probably have created the dice in Blender or something.

The green "cloth" is a normal Flutter widget, that is, I can overlay the 3D scene on top of any widget I like which is a feature I was looking for for ages.


r/FlutterDev • • 1d ago

Plugin I built an automated dynamic app icon generator & switcher for Flutter

15 Upvotes

hi i'm Farook.

Most dynamic icon packages on pub.dev are runtime-only: they give you an API to swap icons, but you still have to manually resize 15+ PNGs and hand-editĀ AndroidManifest.xmlĀ (<activity-alias>) andĀ Info.plistĀ (CFBundleAlternateIcons).

I builtĀ chameleon_iconsĀ to automate both the native setup and the runtime switching.

1. Configure inĀ pubspec.yaml

chameleon_icons:
  default_icon:
    image_path: "assets/icons/default.png"
  alternate_icons:
    - name: "MainActivityDark"
      image_path: "assets/icons/dark.png"
    - name: "MainActivityGold"
      image_path: "assets/icons/gold.png"

2. Run the CLI

dart run chameleon_icons:generate

This automatically:

  • Generates all Android mipmap densities (mdpiĀ toĀ xxxhdpi) and iOS retina assets (@2x,Ā u/3x, iPad).
  • InjectsĀ <activity-alias>Ā tags intoĀ AndroidManifest.xmlĀ (anchored and idempotent; safe to re-run).
  • InjectsĀ CFBundleIconsĀ dictionaries intoĀ Info.plist.

3. Switch icons at runtime

final chameleon = ChameleonIcons();
// Switch icon
await chameleon.changeIcon("MainActivityDark");
// Reset to default
await chameleon.resetIcon();

Tested on Android (API 24+) and iOS (15+). Feedback and issues welcome!

package:Ā https://pub.dev/packages/chameleon_icons
repo:Ā https://github.com/farookeei/chameleon_icons


r/FlutterDev • • 1d ago

Video Cinematic 3D demo with Flutter Scene running at full speed on a mid-range Android phone

24 Upvotes

We built After Dark to see how far Flutter Scene can go right now. 100% Flutter, no Unity, no Unreal.

Watch: https://youtu.be/EoxKooB8qSA
Run in browser: https://primio.dev/demo/after-dark/
Android APK: https://primio.dev/demo/after-dark/primio-afterdark-android.apk

Recorded on a Motorola Edge 70 Pro. One continuous flythrough: space, alien landscapes, neon Tokyo, glowing forests, underground club. Skinned characters, procedural geometry, dynamic lighting, bloom, particles, music-reactive FX.

Made by the Primio team (we sponsor Flutter Scene, the initial code came out of Primio, rest was hand-polished with terminal based coding agents). Huge credit to Brandon DeRosier.


r/FlutterDev • • 2d ago

Article Why Flutter Text Looks Lighter Than SwiftUI on iOS

65 Upvotes

Spent a while figuring out why #Flutter text looks lighter than #SwiftUI on #iOS.

Wrote up the whole thing, with demos you can play with.

https://birju.dev/posts/looking-into-flutter-vs-swiftui-font-rendering/


r/FlutterDev • • 1d ago

Tooling šŸš€ A New Insane Flutter Package? Meet flutter_table_layout — Flexible Table Layouts Made Easier for Flutter Developers!

2 Upvotes

I built flutter_table_layout, a Flutter package for flexible table layouts! šŸš€ As a Flutter developer, I wanted to make building table-based UIs easier and more flexible. I’m sharing my package with the community to get feedback, learn about common table layout challenges, and discover which features developers need most for real-world Flutter applications. What do you think would make a table layout package truly useful? I’d love to hear your suggestions and ideas! https://pub.dev/packages/flutter_table_layout


r/FlutterDev • • 1d ago

Tooling šŸš€ I built Flutter Version Bumper — a CLI tool to automate Flutter & Dart releases

0 Upvotes

Hey Flutter devs! šŸ‘‹

Ever forgotten to increment your build number, manually edited "pubspec.yaml" one too many times, or wished your release workflow was a little less repetitive? šŸ˜…

I built Flutter Version Bumper (FVB) to make that process easier.

It's a command-line tool designed to automate version management for Flutter and Dart projects.

✨ Some key features:

- šŸ“ˆ Semantic Versioning (major, minor, patch & build)

- šŸ”¢ Automatic build number management

- šŸ“ Automated "CHANGELOG.md" updates

- šŸ™ Git automation — commits, tags & pushes

- šŸŖ Git hooks for versioning workflow validation

- 🧪 Dry-run mode to preview changes before applying them

- 🧩 Configuration files for reusable project settings

- 🚦 Pre-release version support ("beta", "rc", etc.)

- šŸ“¦ Custom paths for monorepos

- šŸ¤– JSON output for CI/CD pipelines

- 🧠 AI coding agent skill integration

You can get started with:

dart pub global activate --source git https://github.com/chamod-rashmith/flutter-version-bumper

Then navigate to your project and run:

fvb

The goal is simple: less repetitive release work, fewer manual versioning mistakes, and a smoother development workflow.

šŸ”— GitHub: https://github.com/chamod-rashmith/flutter-version-bumper

šŸ“¦ pub.dev: https://pub.dev/packages/flutter_version_bumper

I'd love to hear your feedback! If you try it, feel free to open an issue or suggest improvements. Contributions are welcome. ā¤ļø

What features would you like to see in a Flutter release automation tool?

#Flutter #Dart #OpenSource #DeveloperTools


r/FlutterDev • • 1d ago

Discussion I released offline_sos_system 0.0.6, a Flutter package for configurable offline crash detection.

2 Upvotes

Hi r/FlutterDev ,

I have released version 0.0.6 of offline_sos_system, an open-source Flutter package I developed for our SafePulse project.

The goal was to build a reusable crash detection engine that can perform inference directly on a mobile device without depending on an internet connection.

While developing SafePulse, I wanted to separate the crash detection logic from the rest of the emergency workflow so that other developers could use it without integrating the entire application.

That work has evolved into a standalone Flutter package. And this is the new version of that package.

What is new in version 0.0.6?

The main addition is configurable crash detection. Developers can now configure the impact threshold used to evaluate sensor data, the minimum model score required for a detection, the fallback impact threshold, and the cooldown interval used to suppress duplicate crash events.

The package uses accelerometer and gyroscope telemetry and TensorFlow Lite for on-device inference. When a crash is detected, it emits a CrashEvent that the application can handle. I have deliberately kept the package headless. It does not dictate how your application handles GPS, emergency contacts, SMS, notifications, or backend communication.

This means you can integrate the detection engine into your own application architecture and implement the emergency workflow according to your requirements.

One important limitation: offline inference does not mean offline communication. The detection process does not require internet access, but sending an SMS still requires cellular service. Sensor-based crash detection can also produce false positives or miss actual crashes, so real-world validation remains important.

I would appreciate feedback from Flutter and machine learning developers on the configuration API, sensor processing, fallback behavior, and ways to improve the implementation.

Package: https://pub.dev/packages/offline_sos_system

Source code: https://github.com/Bhagyaprasad92/offline_sos_system

The project is open source, and constructive criticism, bug reports, and suggestions are welcome.

Thank you for taking the time to review it.


r/FlutterDev • • 2d ago

Discussion Built an algo trading engine in Dart (even though everyone said to just use Python)

21 Upvotes

Hey guys,

Wanted to share a quick feedback on a solo project I've been working on for a while.

The Flutter job market around me was pretty dead, and honestly I was tired of spending my time building someone else's dream. So I decided to get into trading and take it seriously. Since I'm a developer, I went straight into the algorithmic side to make use of my programming skills.

At first, I was worried I'd get rusty on Flutter while spending so much time learning finance. But it turned out to be the exact opposite. This project actually pushed my skills further than anything else, both on Flutter for the UI and Dart on the backend (I started out with dart_frog before taking the architecture further).

Getting started was pretty rough though. Early on, even the AI tools I was using kept warning me against Dart. The consensus was that nobody builds algo trading systems in Dart, that there's zero math/finance ecosystem compared to Python or C++, and that I was just making my life harder.

And to be fair, that part was true: existing packages on pub.dev for financial charts or indicators cost me an insane amount of time. None of them held up in terms of performance or flexibility. I basically had to scrap everything and start from scratch.

The real headache was moving from the trading script mindset (like PineScript on TradingView) to Dart. In trading scripts, everything relies on implicit time series evaluated candle by candle. Translating that cleanly into standard OOP/procedural code without blowing up the memory or recalculating the entire history on every tick was a huge pain.

I ended up writing my own incremental rolling calculation system (RollingCalculation) to maintain state in real time. That's the only thing that allowed me to get the same 60fps smoothness as TradingView while streaming live data.

Dart definitely isn't the go-to language for algo trading, but in the end I managed to build something solid on my own. Something I'm proud of. Anyone else here using Dart in unusual domains where you had to reinvent most of the tooling?


r/FlutterDev • • 2d ago

Tooling I rebuilt pubstats.dev with Jaspr. It is a lot faster now.

5 Upvotes

Hey there. I rebuilt https://pubstats.dev/ with Jaspr. It's a loooooot faster now. Also if you haven't heard of this site before you are able to set up alerts for when your package stats change. It's very useful for getting notified if your package loses pub points and needs updated!


r/FlutterDev • • 1d ago

Discussion Keeping the LLM stream at the network edge: what we learned building a 0ms synchronous A2UI engine in pure Dart (for both Flutter and terminal TUIs)

0 Upvotes

When you build a Generative UI prototype where an LLM streams widget definitions over SSE, the demo looks great as long as the UI is read-only. The pain starts five seconds later when the agent streams an interactive checkout form and the user starts typing.

If the client treats the whole surface lifecycle as an async stream pipeline, every keystroke, cross-field validation check, and widget test ends up fighting microtask delays and full-surface rebuilds. And if an impatient user interrupts the LLM mid-stream—or the connection drops before the first chunk arrives—naive stream handling either corrupts the widget tree or leaves a dangling user turn in chat history that triggers turn-alternation errors on retry.

When we started integrating Google's official A2UI Dart library (a2ui_core), the biggest light-bulb moment was realizing that a2ui_core already uses preact_signals under the hood for its DataModel, WritableBinding, and CheckRule validation. By quarantining the async SSE stream at the perimeter with a restartable() mutex and letting the interior run on a synchronous signal graph, form edits, client-side validation rules, and NodeResolver list templates all update leaf widgets in 0ms in a single tester.pump().

Even better, keeping the core state machine in pure Dart meant we could run the exact same 16-component BasicCatalog in both a Material 3 Flutter app and an interactive ANSI terminal TUI, and bridge it into Riverpod or classic BLoC apps without forcing a rewrite.

For folks experimenting with A2UI or LLM-driven UIs in Flutter, how are you handling two-way form state and mid-stream user interruptions right now?


r/FlutterDev • • 2d ago

Tooling Migrate debugPrint and print calls in a Flutter or Dart package to use package:logging

5 Upvotes

Faced with the problem of migrating debugPrint/print methods of flutter and dart files across multiple packages with large number of files & lines.

Created & pubslihed print_to_log package to automate the the convertion. Used it across 20+ internal packages successfully. It uses analyzer package to parse each file into source tree & walks that tree and then do sugical edits by not touching any other parts.

The package shall be used as a CLI tool or as a dev dependency package.

Github : https://github.com/selvan/print_to_log

Pub.dev: https://pub.dev/packages/print_to_log

It's MIT license.


r/FlutterDev • • 2d ago

Plugin Tandem 0.1.0: an AI agent that works on your existing Flutter screen, through your own methods

4 Upvotes

Hi r/FlutterDev!

I just published Tandem, a package that lets an AI agent work on a screen you already have. The user and the agent use the same form, the agent acts only through your methods, and risky calls wait for the user's approval.

Short demo video: https://x.com/creatixdev/status/2112139150459568361

In your state class you list what the agent sees and what it can call.

Example with Cubit, but you can use anything:

@TandemAgent()
class OrderDeskCubit({…})
    extends Cubit<OrderDeskState>
    with _$OrderDeskCubit {

  @override
  List<AgentCapability> get agentCapabilities => [
    .sees(order),
    .calls(searchCatalog),
    if (canEdit) ...[
      .calls(setCustomer),
      .calls(setQuantity),
      .calls(setDelivery),
    ],
    if (canPlace) .callsWithApproval(placeOrder),
  ];
}

A generator turns your method signatures and doc comments into the tool schemas, and one TandemScope widget connects the screen to the agent.

  • It talks AG-UI, so the agent runs on your own backend. The example uses Google ADK, and you can try it without an API key.
  • Works with bloc, Riverpod or provider.
  • No chat UI in the package. The example has one you can copy.

Not there yet: AG-UI interrupts, several state objects on one screen, and a conversation that goes on across screens. It's written with AI assistance and reviewed by hand, except the protocol layer and the generator, and the README says so.

It's 0.1.0, so the API can still change. Feedback and issues are very welcome!

GitHub: https://github.com/leancodepl/tandem pub.dev: https://pub.dev/packages/tandem


r/FlutterDev • • 2d ago

Dart Flutter background location stops updating when the screen is locked and what worked for me

3 Upvotes

I've been working on a Flutter app that needs to track location while running in the background. One of the hardest parts was making location updates behave reliably after locking the screen or putting the phone in a pocket. Calling the location API isn't enough; Android background execution, permissions, foreground-service requirements, and battery restrictions all matter. I worked on a custom solution using Dart and native Android code, tested it on a real Android device, and packaged the implementation into a reusable engine. I'm sharing it in case it helps other developers facing the same problem. I'm also interested in how others are handling this, especially across different Android versions and manufacturers. Product and implementation details: https://nabilkrs.github.io/nabilkrs-flutter-gps-tracking-engine/ I'm the creator of this project, so this is also a disclosure that the link is promotional. Happy to discuss the technical challenges.


r/FlutterDev • • 2d ago

Plugin I built a cursor-safe input formatter for Indian data (Aadhaar, PAN, ₹ currency) because existing ones kept breaking the cursor.

4 Upvotes

Hey r/FlutterDev,

I've been building a lot of fintech/e-commerce apps lately, and I kept running into the same issue: handling Indian input formats (Aadhaar spacing, lakh/crore commas, +91 prefixes) usingĀ TextInputFormatterĀ is a nightmare.

Specifically,Ā the cursor always jumps. When a user types the 5th digit of an Aadhaar number and the formatter auto-inserts a space, the cursor flies to the end of the string. Or when a user hits backspace over a comma, it deletes the wrong digit.

Since most existing packages either forced me to use their customĀ TextFieldĀ widget or didn't handle the cursor math correctly, I decided to build my own standalone formatters.

I just publishedĀ indian_input_formatterĀ (v0.1.0).

  • The solution:Ā I wrote a customĀ CursorMapperĀ that counts "significant characters" (digits/letters) instead of raw offsets. It maps the cursor back to the exact right spot, regardless of spaces, commas, or prefixes.
  • What it supports:Ā StandaloneĀ TextInputFormatterĀ classes for Aadhaar (Verhoeff checksum), PAN, GSTIN (Luhn mod-36), IFSC, UPI, +91 phones, and ₹ Lakh/Crore currency.
  • Zero dependencies:Ā Pure Dart. 59 tests focusing heavily on cursor edge cases (middle insertion, backspace at boundaries, paste).

I'd love for anyone building Indian apps to try it out. More importantly,Ā I'd love a code review on the cursor logicĀ if anyone has tackled this before.

Thanks!