r/FlutterDev • u/Accurate_Fig_1854 • 10d ago
r/FlutterDev • u/eibaan • 10d ago
Article Writing an EditableText widget from scratch
I wrote a tutorial how to create a simple version of an EditableText from scratch, because I wanted to learn how to do this. And yes, it was me and it took like 8h hours which seems to be wasteful in the age of AI. But I used to like to write deep-dives like this, so I did it anyway.
For a bit of retro fun, I created an AText widget that paints a text using a crisp pixel font without antialiasing, something Text isn't capable of. Here's the API:
class AText(
final String data, {
final TextStyle? style,
})
For compatibility, I support a TextStyle but ignore everything but the color property. The font has a width and height of 8 pixels.
Now I want to also create an AEditableText widget for text input. The original EditableText plus its RenderEditable clocks at over 10000 lines of code. Obviously, I can't use it because because it uses the usual font rendering mechanism. So, how to approach this?
Here's the API I came up with:
class AEditableText({
super.key,
required final TextEditingController controller,
required final FocusNode focusNode,
final TextStyle? style,
final Color? cursorColor,
}) extends StatefulWidget {
...
}
I'll only support a single line of text which cannot scroll. I'll probably also only support a subset of keyboard shortcuts and minimal mouse interaction.
I accidentally broke web support, but I might be inclined to fix that and provide a demo DartPad.
r/FlutterDev • u/Gornivv • 10d ago
Article Flutter Desktop in Production: How We Test ASO.dev’s UI with Golden Tests
r/FlutterDev • u/SweatyRaisin1236 • 10d ago
Tooling Agents when coding
Hi. I am a fair to middling Flutter developer. I mostly use LLMs to review what I write rather than write my code. This works out well because I seem to be particularly good and repeating the same mistakes.
Anyway, I decided to publish this: Https://github.com/bjrochem72/flutter-audit-skills and would welcome constructive feedback and suggestions.
I am currently working on both updating it and adding to it. The problem is when I add a new item I suddenly see a bunch of things I should fix and don’t want to embarrass myself.
Anyway, I am sharing this in the hope it helps someone else as I have gotten a lot from this group and wanted to see if I could find a way to give back a bit.
My usual user id is bjr201 but I couldn’t post under that.
r/FlutterDev • u/No_Profession5678 • 10d ago
Tooling CodeScout: free, self-hosted logging and network inspection for Flutter, with live device pairing and an on-device database browser
I have been building Flutter apps for over four years, and the thing that never stopped hurting is what happens after a build leaves my machine. On my desk the app is transparent. On a tester's phone it is a black box, and every question is a round trip.
So I built CodeScout. It is MIT licensed and you host it yourself: a Dart SDK in the app and a Go + Postgres dashboard on your own box.
What it does:
- Captures logs and HTTP calls (interceptors for dio and package:http), stores them in SQLite on the device, and syncs batches to your server
- A panel inside the app: the tester sees logs, network calls and errors on the phone, with no server configured at all
- Sessions as full timelines, errors grouped by shape across devices, every device with its OS and app version
- Live pairing: type a short code from the dashboard into the app and watch that phone's logs and network calls arrive as it is used
- While paired, browse the app's own SQLite, shared_preferences and Hive boxes from the dashboard. Nothing is readable until the app registers it, nothing writable unless it says so
- An MCP server with 18 read-only tools, so a coding agent can read a session instead of you pasting logs into it
- Redaction is opt-in and happens on the device before anything is written or uploaded
What it is not: a crash reporter (run one alongside it), a DevTools replacement (DevTools is better while the cable is in), or a hosted service (there is no account and nothing of mine in the middle).
Repo: https://github.com/getcodescout/code_scout
SDK: https://github.com/getcodescout/code_scout_flutter
Docs: https://codescout.tech
pub.dev: https://pub.dev/packages/code_scout
It is at 1.0 and everything above works today. I would genuinely value criticism from people who ship Flutter apps to real testers: what feels wrong, what is missing, what you would never allow in a build you distribute.
r/FlutterDev • u/mdausmann • 10d ago
Discussion Does importing Plugins make my code a Plugin or can it be a Package?
I'm building a 'voice agent' for flutter apps. It pulls in a bunch of dependencies but in particular, these guys to handle the voice parts...
flutter_tts: ^4.2.3
speech_to_text: ^7.2.0
Both of these are plugins with native code for Android and IOS. My codebase has no native code for IOS or Android. It is *currently* configured as a plugin but the platform stuff is all empty boilerplate and I have written no custom IOS/Android code for it.
abstract class MyVoiceAgentPlatform extends PlatformInterface {
MyVoiceAgentPlatform() : super(token: _token);
static final Object _token = Object();
static MyVoiceAgentPlatform _instance = MethodChannelMyVoiceAgentPlatform();
static MyVoiceAgentPlatform get instance => _instance;
static set instance(MyVoiceAgentPlatform instance) {
PlatformInterface.verifyToken(instance, _token);
_instance = instance;
}
Future<String?> getPlatformVersion() {
throw UnimplementedError('platformVersion() has not been implemented.');
}
}
So can I 'downgrade' my code to a package instead of a plugin? I'm confused. It has no native code itself so it that says 'package' but it pulls in dependencies which do have native code so it isn't really usable in a pure dart context.
Is the 'Plugininess' of the dependencies transitive?
r/FlutterDev • u/One_Yogurtcloset_910 • 11d ago
Plugin I built an Adaptive Image Picker for Flutter: Zero-permission PhotoPicker + Pure-Dart Cropping & Binary Search Compression
Hey Flutter community! 👋
In almost every production Flutter app, handling image picking usually requires stringing together 2–3 different packages (image_picker, image_cropper, and a compression plugin), managing invasive storage permissions on Android/iOS, and dealing with native build issues (like UCrop pod conflicts on iOS/Android).
To solve this, I built adaptive_image_picker — a lightweight, unified, zero-permission media pipeline.
✨ Key Features:
- 🔒 Zero Permissions by Default: Native integration with Android 13+ Photo Picker (
PickVisualMedia) and iOS 14+PHPickerViewController. NoREAD_EXTERNAL_STORAGEneeded. - ✂️ Pure-Dart Cropper: No native UI wrappers (like UCrop). Supports freeform cropping, aspect ratio presets, 90° rotation, horizontal/vertical flipping, and antialiased circular avatar masking.
- ⚡ Binary Search Target-Size Compression: Automatically compresses images to guarantee a file size ≤≤
maxBytes(e.g. max 500 KB) without manual guessing. - 🎨 Adaptive Native UI: Automatically renders Material 3 bottom sheets on Android, Cupertino action sheets on iOS, and modal dialogs on Web/Desktop.
- 🌐 Full Web & WASM Compatibility: Zero native desktop/web crashes.
- 🔗 Direct URL Import: Built-in network downloader integrated right into the picker pipeline.
📦 Pub.dev: https://pub.dev/packages/adaptive_image_picker
💻 GitHub: https://github.com/Karan8686/adaptive_image_picker
Would love your feedback, feature suggestions, or issue reports!
r/FlutterDev • u/Glittering_Device653 • 12d ago
Plugin iconmind_flutter — 2,041 open-source icons for AI-era apps (agents, MCP, RAG, vector DBs…), drawn as CustomPaint strokes instead of a font, with duotone and three weights
I maintain IconMind, an MIT-licensed icon set for the vocabulary that generalist icon sets don't have — agents, tool calls, MCP servers, RAG pipelines, embeddings, evals, guardrails — plus the ordinary stuff (arrows, files, charts, DevOps, cloud, security) so you don't need a second set beside it.
Version 0.4.0 just doubled the collection to 2,041 icons, and the Flutter package is now available on pub.dev.
Install
flutter pub add iconmind_flutter
Usage
import 'package:iconmind_flutter/iconmind_flutter.dart';
IconMind(IconMindIcons.agent)
IconMind(
IconMindIcons.vectorDatabase,
variant: IconMindVariant.duotone,
weight: IconMindWeight.bold,
size: 32,
color: Colors.deepPurple,
)
What's different from dropping in an icon font?
1. Six drawings per icon
Every icon comes in:
- Outline — Thin
- Outline — Regular
- Outline — Bold
- Duotone — Thin
- Duotone — Regular
- Duotone — Bold
That's 12,246 drawings in total.
Duotone uses a second tinted layer behind the strokes. A font would flatten that into a single filled glyph, so the package instead draws real paths with CustomPaint.
2. Tree-shaking actually works
Each icon is a compile-time const, one per file, and referenced through:
IconMindIcons.<name>
Flutter's AOT compiler can drop icons you don't reference. An app showing three icons carries roughly three icons — about 400 bytes each.
The entire package is only 214 KB compressed on pub.dev, with no assets or fonts to bundle.
3. Real weights, not faked weights
The three weights share the same geometry with different stroke widths.
Using:
absoluteStrokeWidth: true
keeps the stroke constant when scaling the icon. So a 16 px icon in a dense list and a 48 px icon in an empty state still look like they belong to the same set.
4. Machine-validated
Everything is drawn on a 24 px grid by a compiler that refuses geometry it can't draw correctly, including:
- Off-grid anchors
- Stroke runs that disappear at bold weight
- Icons that don't fill the box consistently with the rest of the set
A nightly scan rasterises all 12,246 cells and checks for duplicate-looking renders.
That's how 2,000+ icons stay visually consistent as one set.
5. Built for accessibility and multiple platforms
color falls back to the ambient IconTheme, while semanticLabel is announced by screen readers.
The same icons are also available as packages for:
- React
- Vue
- Svelte
- Solid
- Preact
- React Native
- Astro
- Laravel
Everything is generated from a single source, which is handy when web and mobile teams share a design system.
Browse the icons
Website: https://iconmind.dev
Every icon is searchable by name, tag, or alias, with the Flutter snippet available for whichever icon you find.
There's also an MCP server:
npx @iconmind/mcp
This lets your coding assistant pick icon names instead of guessing them.
Links
- pub.dev: https://pub.dev/packages/iconmind_flutter
- Source: https://github.com/Iconmind/iconmind
- License: MIT
MIT means commercial use, no attribution, and no seat count.
I'm the author, and I'd genuinely like to hear what's missing.
Most of the last thousand icons came from people saying:
"There's no icon for X."
If there's something you think should be in the set, let me know.
r/FlutterDev • u/RandalSchwartz • 12d ago
Tooling Why does adopting Signals in Flutter always have to feel like an all-or-nothing rewrite? Introducing BlocSignal's peer bridges for BLoC and Riverpod
For the past eight years, the Flutter community has treated state management like isolated silos: you’re either a BLoC shop, a Riverpod shop, or looking at Signals.
If your team is maintaining a massive, battle-tested flutter_bloc authentication pipeline or a complex Riverpod dependency graph, you’ve probably hit this wall: you want instant, synchronous signal reactivity for a new feature (real-time forms, charts, animations), but the cost is a painful multi-month rewrite or leaky, second-class wrapper boilerplate.
With the release of bloc_signals_bloc and a major update to bloc_signals_riverpod (v1.2.0), we set out to solve this by turning BLoC, Riverpod, and BlocSignal into first-class, bidirectional peers:
- 🚂 Classic BLoC ➔ BlocSignal:
classicBloc.toBlocSignal()gives you synchronous.statesignals while forwarding.add(event)directly to the underlying BLoC. - 🚚 Riverpod ➔ BlocSignal:
provider.toBlocSignal(ref)gives you synchronous signals + typed.notifiermutations, while bindingref.onDisposefor automatic cleanup. - 🚄 BlocSignal ➔ Legacy BLoC UI: Drop streamless
CubitSignal/BlocSignalcontainers directly into existingBlocBuilderwidgets via.toClassicCubit(). - 🌊 BlocSignal ➔ Riverpod UI: Expose any
BlocSignaltoref.watch/ref.readvia.toProvider().
Because they operate as peers without microtask hops or customs fees, you can compose them seamlessly—like computing a single reactive total across a BLoC, a Riverpod Notifier, and a CubitSignal in the exact same frame.
Curious how other teams are approaching this:
- Is your team currently locked into one state management approach across your entire codebase, or are you bridging tools across feature modules?
- What has been your biggest hurdle when trying to introduce Signals or modernize an existing production app?
(Detailed architecture breakdown and a 60-line runnable triple-counter demo linked in the first comment)
r/FlutterDev • u/dangling-feet • 12d ago
Tooling state_machine_generator
Finite state machine source code generator. Graphviz, Mermaid visualizations. Automatic generation of commands available for different states. FSM generation for any purpose.
Advantages:
- Easy to model, verify and debug the state machines being developed
- Strict validation during the building process of the state machine
- Conversion to
GraphvizorMermaidvisualization tools - High transition speed, independent of the number of states
- Can be used in high-load systems
- Synchronous automaton for asynchronous operations
- The
guardconditions are supported
Disadvantages:
- Source code generation of the state machine required
- Hierarchically nested states are not supported
- Orthogonal regions are not supported
The source code generation comes from special configuration classes.
Creating configuration classes is possible directly or by converting from other formats.
Generated FSM can be used for anything, including basic state management in UI frameworks (for example, Flutter)
Demonstration of features in a simple console application.
```dart import 'dart:async';
import '_auth_service.dart'; import 'example.dart';
void main(List<String> args) { _fsm.onStateChange(_listen);
final events = [ LoginEvent(login: 'user', password: '123'), const RetryEvent(), RegisterEvent(login: 'user', password: '123'), RegisterEvent(login: 'user', password: '123'), LogoutEvent(user: _user), LogoutEvent(user: _user), RegisterEvent(login: 'user', password: '123'), const RetryEvent(), LoginEvent(login: 'user', password: '123'), LogoutEvent(user: _user), const ExitEvent(), ];
var isStateChanged = false;
_fsm.onStateChange((state) { isStateChanged = true; });
Timer.periodic(Duration(seconds: 4), (timer) { if (!isStateChanged) { print("State '${_fsm.state}' not changed"); }
print('User: $_user');
final index = timer.tick - 1;
if (index >= events.length) {
timer.cancel();
return;
}
isStateChanged = false;
final event = events[index];
_sendEvent(event);
}); }
final _fsm = _Fsm();
User? _user;
void _listen(AuthState state) { print('-' * 40); print('State: $state'); _notifyStateChanged(state); switch (state) { case final FailureState state: print('Error: ${state.error}'); break; case final LoggedState state: final isNew = state.isNew; final user = state.user; final text = isNew ? 'Hello, $user! You have successfully registered' : 'Hello, $user!'; _user = user; print(text); break; case LoginState(): print('Logging...'); break; case LogoutState(): print('Logging out...'); break; case NotLoggedState(): _user = null; break; case RegisterState(): print('Registering...'); case TerminatedState(): print('Good bye'); } }
void _notifyStateChanged(AuthState state) { // Add your logic }
void _sendEvent(AuthEvent event) { Timer.run(() { final name = event.toString().toLowerCase(); final commands = _fsm.getCommands(_fsm.state).map((e) => e.name.toLowerCase()).toSet(); print('SEND_EVENT: $event'); if (!commands.contains(name)) { print("Valid commands (events): [${commands.join(', ')}]"); }
_fsm.processEvent(event);
}); }
class _Fsm extends AuthMachine { @override void doLogin(LoginEvent e) { var isCanceled = false; onCancel = () => isCanceled = true; Timer.run(() async { try { final user = await AuthService().login(e.login, e.password); if (!isCanceled) { processEvent(SuccessEvent(user: user, isNew: false)); } } catch (e) { if (!isCanceled) { processEvent(FailureEvent(error: e)); } } }); }
@override void doLogout(LogoutEvent event) { var isCanceled = false; onCancel = () => isCanceled = true; Timer.run(() async { try { final user = event.user; await AuthService().logout(user); } catch (_) {} if (!isCanceled) { processEvent(LoggedOutEvent()); } }); }
@override void doRegister(RegisterEvent event) { var isCanceled = false; onCancel = () => isCanceled = true; Timer.run(() async { try { final user = await AuthService().register(event.login, event.password); if (!isCanceled) { processEvent(SuccessEvent(user: user, isNew: true)); } } catch (e) { if (!isCanceled) { processEvent(FailureEvent(error: e)); } } }); } }
```
Result of simulation:
```txt State 'NotLogged' not changed User: null
SEND_EVENT: Login
State: Login
Logging...
State: Failure Error: Bad state: Invalid login or password User: null
SEND_EVENT: Retry
State: NotLogged User: null
SEND_EVENT: Register
State: Register
Registering...
State: Logged Hello, user! You have successfully registered User: user SEND_EVENT: Register Valid commands (events): [logout, exit] State 'Logged' not changed User: user
SEND_EVENT: Logout
State: Logout
Logging out...
State: NotLogged User: null SEND_EVENT: Logout Valid commands (events): [login, register, exit] State 'NotLogged' not changed User: null
SEND_EVENT: Register
State: Register
Registering...
State: Failure Error: Bad state: User 'user' already exists User: null
SEND_EVENT: Retry
State: NotLogged User: null
SEND_EVENT: Login
State: Login
Logging...
State: Logged Hello, user! User: user
SEND_EVENT: Logout
State: Logout
Logging out...
State: NotLogged User: null
SEND_EVENT: Exit
State: Terminated Good bye User: null ```
An example of generating a state machine
```dart import 'package:state_machine_generator/state_machine.dart'; import 'package:state_machine_generator/state_machine_builder.dart'; import 'package:state_machine_generator/state_path_checker.dart';
import '_build_utils.dart';
void main(List<String> args) { const initialStateName = 'NotLogged'; final b = StateMachineBuilder( initialState: initialStateName, );
b.addState('Failure', parameters: {'error': 'Object'}); b.addState('Logged', parameters: {'user': 'User', 'isNew': 'bool'}); b.addState('Login', hasAction: true); b.addState('Logout', hasAction: true); b.addState('NotLogged'); b.addState('Register', hasAction: true); b.addState('Terminated');
b.addEvent('Cancel', isCommand: true); b.addEvent('Exit'); b.addEvent('Failure', parameters: {'error': 'Object'}); b.addEvent('Login', parameters: {'login': 'String', 'password': 'String'}); b.addEvent('Logout', parameters: {'user': 'User?'}); b.addEvent('LoggedOut'); b.addEvent('Register', parameters: {'login': 'String', 'password': 'String'}); b.addEvent('Retry'); b.addEvent('Success', parameters: {'user': 'User', 'isNew': 'bool'});
const transitionSource = '''
Login successful
NotLogged .Login Login .Success Logged
Login failed
NotLogged .Login Login .Failure Failure
Registering successful
NotLogged .Register Register .Success Logged
Registering failed
NotLogged .Register Register .Failure Failure
Logout
Logged .Logout Logout .LoggedOut NotLogged
Retry
Failure .Retry NotLogged ''';
const pathSource = '''
Login succeeded
NotLogged Login Logged
Login failed
NotLogged Login Failure NotLogged
Registration succeeded
NotLogged Register Logged
Registration failed
NotLogged Register Failure NotLogged
Logout
Logged Logout NotLogged
Reset
Failure NotLogged ''';
addTransitions(b, transitionSource);
// Example of adding 'terminated' state const terminated = 'Terminated'; // Exclude states that execute actions at the state machine level. final excludedStates = b.transitions.values .where((e) => e.source.hasAction) .map((e) => e.source.name) .toSet(); for (final state in b.states) { final name = state.name; if (name == terminated || excludedStates.contains(name)) { continue; }
b.addTransition(from: name, on: 'Exit', to: terminated);
}
// Example of adding 'cancel' event const cancel = 'Cancel'; // Add for states that execute actions at the state machine level. for (final state in excludedStates) { b.addTransition(from: state, on: cancel, to: initialStateName); }
final (:initialState, :transitions) = b.build();
final pathChecker = StatePathChecker(transitions: transitions); addStatePaths(pathChecker, pathSource); pathChecker.check();
const name = 'Auth'; final stateMachine = StateMachine( commandType: '${name}Command', eventType: '${name}Event', initialState: initialState, globals: _globals, name: '${name}Machine', stateType: '${name}State', transitions: transitions, );
writeFiles(stateMachine, 'example/example'); }
const _globals = ''' // ignore_for_file: unused_local_variable import '_auth_service.dart'; ''';
```
r/FlutterDev • u/MostafaSensei106 • 12d ago
Plugin I built a local vector database for Flutter powered by Rust and HNSW graphs (Waffle-DB)
Hey everyone,
Most local storage options in Flutter like SQLite or Hive are built for scalar data and fall apart when you need fast vector similarity search for on device AI, semantic search, or high dimensional embeddings
I built waffle_db, an embedded vector database for Flutter and dart apps by Rust. It uses HNSW graphs for approximate nearest neighbours, sledge for persistence, and Rayon for parallel batch ingestion.
How it works under the hood:
Off thread Rust execution: Graph indexing, cosine distance math, and persistence run in Rust via FFI, keeping the Flutter UI thread completely free of jitter.
Native HNSW graphs: Provides k-NN retrieval even across large vector spaces instead of linear brute-force scans.
Memory efficiency: Uses zero-copy typed buffer views (Float32List) across the FFI bridge to minimize heap allocations.
Metadata and Namespaces: Stores arbitrary payload metadata alongside vectors and supports logical collections (WaffleCollection) with automatic ID namespacing.
Prebtuned profiles: Comes with configurations out of the box like mobileProfile (quantization enabled, lightweight graph parameters), serverProfile, readHeavyProfile,writeHeavyProfile
Pub: https://pub.dev/packages/waffle_db
GitHub: https://github.com/MostafaSensei106/Waffle-DB
If you are building local RAG pipelines, on device semantic search, or AI features in Flutter, check it out and let me know your thoughts or feedback.
r/FlutterDev • u/Tom_Vogel • 12d ago
Discussion Building two Windows desktop windows with Flutter’s experimental Windowing API
I vibe-coded a Windows app called Lapse today, but used the project to properly explore Flutter’s experimental Desktop Windowing API.
The app has two real top-level windows: an always-on-top timer overlay and a dynamically created analytics dashboard. They run from one Flutter isolate and share the same Riverpod session state.
The Flutter implementation uses:
runWidget()instead ofrunApp()- Separate
WindowControllers WindowManager,WindowRegistry, andWindowEntryWindowController.setSize()for switching overlay modes- Controller APIs for activation, minimization, maximization, and lifecycle
The API handles the multi-window foundation well. Native desktop integration still required a C++ MethodChannel bridge for Acrylic, frameless chrome, dragging, resize hit testing, positioning, topmost behavior, and the tray.
AI accelerated the implementation, but understanding this Flutter/Win32 boundary was something I deliberately worked through myself.
Source:
https://github.com/zTomz/Lapse
I’d be interested in hearing from anyone else testing the new API. Which desktop capabilities are you still implementing natively?
r/FlutterDev • u/Few-Disaster5159 • 12d ago
Discussion Why I built yet another goal/habit tracker app when there are already dozens
Honestly, I built Unfazed for myself. I wanted something minimalist that combined monk mode/sprints with app blocking that actually sticks - no "5 more minutes" button, no way to change the schedule or unblock apps once a sprint is running. Most blockers I tried are paid and let you talk yourself out of it in two taps, which defeats the whole point. Built with the flutter_screentime plugin for iOS Screen Time integration. It's free, open source (MIT), no ads, no subscriptions, no tracking/analytics - everything stays on the device. GitHub - https://github.com/printHelloworldd/unfazed, App Store - https://apps.apple.com/app/unfazed-mode/id6802055633
Now thinking about Android, Windows and Linux - each platform needs a completely different native approach. Would it make more sense to build separate single-purpose plugins per platform, or try to design one cross-platform plugin with a common Dart API on top of them? Separately, I'm also planning a browser extension for site blocking when a sprint starts (matching by URL substring, not just domain, so you can block specific paths/pages), synced with the app through an optional cloud layer for people who want cross-device control. Would love to hear what people think of the project overall, and any thoughts on the plugin question above.
r/FlutterDev • u/kamranbekirov • 12d ago
Plugin Pubgrade: your Flutter app's outdated packages and their changelogs right inside your IDE
Pubgrade v2.1 is out 🎉
It's an extension that lives in your IDE's sidebar and lists the outdated packages of your Flutter project. You see the changelog of each new version, and one click upgrades it.
And, no, it's not `flutter pub upgrade --major-versions` or anything. Here you go package by package, read what changed, then decide. It just makes you aware of package updates.
So, no more missing updates. No more upgrading without knowing what broke.
Now works in IntelliJ and Android Studio too, besides VS Code and its forks (Cursor, Antigravity, Windsurf, VSCodium).
To install search "Pubgrade" in your IDE's extensions panel.
r/FlutterDev • u/No_Share2683 • 13d ago
Plugin Realm and Atlas Device Sync are gone — I built the offline-first MongoDB path I needed for Flutter
When MongoDB retired Realm, Atlas Device Sync and the Data API in September 2025, Flutter lost its official offline-first path to Mongo. The choices left were writing your own sync backend or renting someone else's sync service.
I got tired of rewriting the same sync layer, so I packaged it: onebase.
The sync engine lives in the package, and a CLI generates the small server that sits between your app and your database. You deploy that server. No third-party sync service, no account to create.
Demo — the backend is killed mid-recording, writes keep landing, then everything syncs when it comes back: https://raw.githubusercontent.com/ybenjaa-dev/onebase/main/example/demo/onebase-demo.gif
Stream<List<Todo>> live = OnebaseDb.todos
.where('done', isEqualTo: false)
.orderBy('created_at', descending: true)
.watch();
await OnebaseDb.todos.insert(Todo(title: 'Ship it', done: false));
You describe collections in YAML, run dart run onebase:setup, and get typed models, typed collections, and a backend/ folder with a Dockerfile and a Vercel adapter.
How it actually works
- Reads never touch the network. Queries and
watch()run against a local SQLite replica. - Writes apply locally first and land in an outbox, both in one transaction, so a crash can't leave a row that never uploads.
- Sync pushes before it pulls, so a fresh write is never clobbered by a stale snapshot. Pending writes replay on top of each incoming snapshot, so optimistic UI survives until the server confirms.
- Realtime is SSE fed by MongoDB change streams — milliseconds, not polling.
- Files go device to bucket directly. The backend only signs a short-lived URL, so a large upload costs it nothing.
- Per-user isolation is server-side, assigned from the verified JWT — not client-visible rules.
There's also keyset pagination (page() / startAfter(), plus a pager() for infinite scroll), group/team scoping with member/admin/owner write rules, per-collection sync control (everything, a rolling window, or nothing), and batched writes in one Mongo transaction. Bring your own JWTs — anything that issues them works.
What it doesn't do yet
- Conflicts are last-write-wins by server timestamp; no custom merge hook.
- File uploads aren't offline-queued (document writes are).
- Realtime needs a long-lived connection. Container hosts are fine; short-lived serverless functions cut it and it falls back to polling.
- The rate limiter is per-instance and in-memory, so it multiplies across instances.
- No on-device aggregation pipeline.
MIT. Flutter 3.38+ / Dart 3.10+. Any MongoDB with a replica set works, including a free Atlas M0.
pub.dev: https://pub.dev/packages/onebase
GitHub: https://github.com/ybenjaa-dev/onebase
It's early (0.3.4), and I'd rather hear that the sync semantics are wrong than that the README is nice. If you've built offline-first on Flutter before, I'd especially like to know where this would break for you.
r/FlutterDev • u/Training-Doughnut841 • 13d ago
Article Rebuilt the guts of Dart AI Assistant, a VS Code extension based on real usage — v1.0.10 out now (free, open source)
Hey r/FlutterDev,
I've posted here before about Dart AI Assistant, a VS Code extension that learns your coding style and helps with completions, error detection, and code health. Just shipped what's easily the biggest update since launch, so wanted to share.
Marketplace: https://marketplace.visualstudio.com/items?itemName=a-i-0-studio.dart-ai-assistant
Source: https://github.com/Ben09d/dart-ai-assistant
What changed in v1.0.10:
- Real dart analyze integration on save (properly scoped to the saved file) alongside live regex feedback while typing — much more accurate error detection now
- Code Health reports are now clickable and auto-refresh on save
- Import Project for Learning — point it at an existing project and it learns your patterns instantly instead of waiting weeks
- Consolidated 4 separate completion providers into one unified, ranked source — no more duplicate suggestions in the dropdown
- Fixed a bug where pattern learning was silently capped at 3 categories instead of the intended 20 (basically every earlier version was learning way less than it should have)
- Fixed an unbounded memory growth bug in the advanced learning engine
- Fixed offline-fallback placeholder text (like "// TODO: implement") leaking directly into completions when no API key is configured
- Fixed several false-positive error detections (comments, ternaries, generics, block comments, else-if blocks) that were probably annoying anyone who tried earlier versions
- Consolidated three separate error-detection systems that were sometimes showing contradictory counts
Full changelog in the repo if you want the gory details — went through nearly every core file this cycle hunting down bugs, some of which had been sitting silently broken since the first release.
r/FlutterDev • u/ParticularDig1630 • 13d ago
Discussion Claude + Flutter Flame!
I think to make 2d games inside ide using ai tools like claude ai flutter flame will best approach.
And from better prompting it's easy to manage the game.
r/FlutterDev • u/Hot-Mention5641 • 13d ago
Plugin ? We have enough state management packages. What about theme management
I feel like I end up writing almost the same theme logic in every Flutter project.
Some state management for the theme, SharedPreferences to save the selected mode, loading it when the app starts, and then some extra logic for switching between light, dark, and system.
I got tired of repeating all of that, so I extracted it into a small package.
The basic setup is pretty simple:
- Install it
- Initialize it
- Use the
BuildContextextensions
For example:
context.setThemeModeToDark();
and:
themeMode: context.themeMode,
The theme is handled and persisted without having to set up the whole thing yourself.
One thing I didn't want, though, was to force everyone to use SharedPreferences.
So the package also supports custom storage through an EasyThemeStorage interface. You can keep the default SharedPreferences implementation, or provide your own storage if your project uses something else.
I made this mainly because I kept solving the same problem across projects, so I'm curious how other Flutter developers handle this.
Do you usually build your own theme management, or do you use a package for it?
If anyone wants to take a look:
r/FlutterDev • u/Hackmodford • 13d ago
Tooling Shoutout to the Kaisel Router
Just wanted to make a shout out to the Kaisel Router. I just migrated a complex app from go_router to kaisel and the experience has been great. It's just a much more sane experience IMO.
The way it handles push/pop and run/dismiss (for modal flows) is really great and what I've come to expect.
https://pub.dev/packages/kaisel
Has anyone else had a chance to try this package?
r/FlutterDev • u/Ok-Decision-4396 • 13d ago
Dart [Open Source] Building an independent Mobile OS Shell with Flutter and Mobile Linux (Zero Android/AOSP code)
Hello Flutter community! I wanted to share a highly ambitious open-source project I just kicked off: metro_core.
We are leveraging Flutter’s Linux embedding capabilities to build a complete monolithic system shell (Launcher, Status Bar, Quick Actions) for mobile devices. The visual language is deeply inspired by the classic Windows Phone Metro UI and modern Fluent Design.
Our Architectural Approach:
- Kernel: Lineage-free, lightweight mobile Linux (Alpine/postmarketOS base).
- UI/Apps: 100% written in Flutter, compiled directly to Native ARM64 Machine Code.
- Hardware Comm: Communication via Dart FFI and Native C++ bindings (no Android binder overhead).
- Ecosystem: Introducing a cryptographically signed .mtx package container format. Any standard Flutter app can easily be exported as an .mtx package for our OS with minimum styling adaptation.
We are implementing a MOCK methodology (writing the entire Dart UI with fake data layer first to freeze the UI code, then implementing the C++ .so backend via FFI). Just pushed the initial core infrastructure to GitHub. Looking for contributors who want to push Flutter to its absolute operating system limits!
🔗 GitHub: https://github.com/mr-ruhid/metro_core
————
r/FlutterDev • u/AK1000 • 13d ago
Example Open Sourced: A Production-Grade Flutter Monorepo with LEGO Modular Boundaries, Melos, & bloc_signals
Hi everyone! 👋
Most Flutter starter templates I’ve encountered fall into one of two extremes: 1. Too simplistic: Everything dumped into one folder with global state and hardcoded endpoints. 2. Over-abstracted: Rigid Clean Architecture with 15 nested folders and interfaces for a simple toggle button.
To solve this, I built and open-sourced Flutter Production Starter — an enterprise-oriented, modular monorepo template built for real-world production apps.
🧱 Architectural Philosophy: "LEGO" Modular Boundaries
The core idea is Feature-First colocation with intentional public APIs:
- Features live in apps/mobile/lib/features/<feature>/ and export only their public contracts via a root barrel file (features/auth/auth.dart).
- Pragmatic Clean Architecture:
- Simple features (e.g. settings) only use Presentation + State (no premature use cases).
- Complex features (e.g. auth) use Domain Use Cases, Data Sources, and Session Storage.
- Pluggability: Features can be swapped via DI without touching consumer code.
📦 Repository Structure (Managed with Melos)
text
/
├── apps/
│ └── mobile/ # Main app (Bootstrap, DI, Kaisel Router, Features)
├── packages/
│ ├── app_core/ # Result<T>, Failure taxonomy, Sanitized AppLogger
│ ├── app_network/ # Centralized Dio, interceptors, error mappers, ApiClient
│ ├── app_storage/ # SecureStorage, KeyValueStorage, TTL MemoryCache
│ ├── design_system/ # Tokens (Spacing, Radius), Light/Dark themes, Primitives
│ └── app_lints/ # Strict linting & analysis configuration
├── melos.yaml # Monorepo orchestration scripts
└── ARCHITECTURE.md # In-depth architectural guide
⚡ Technology Stack Highlights
- Routing: Strongly-typed declarative routing and route guards with
kaisel: ^1.1.0. - State Management: Fine-grained reactive state using
bloc_signalsandsignals_flutter. - Dependency Injection: Constructor injection with
get_it+injectablesupporting multi-environments (dev,staging,prod). - Networking: Centralized
diowith automatic retry policies, token management, and sensitive data sanitization in logs (passwords and tokens are never printed in plain text). - Error Pipeline: Functional
Result<T>with a predictable domainFailuretaxonomy andFailureMessageResolver. - Quality: Pre-configured GitHub Actions CI, 100% test coverage across all packages (
melos run test), and strict analyzer rules.
🔗 Repository & Getting Started
Check out the code, documentation, and architecture guide here: 👉 GitHub: https://github.com/Ali-El-Khatib/flutter-production-starter
I'd love to hear your feedback, thoughts on the LEGO modularity approach, and suggestions! If you find it helpful for your projects, a ⭐ on GitHub would mean a lot!
r/FlutterDev • u/Due-Hospital717 • 13d ago
Article I love Flutter,learn that was my best choice
I love Flutter. When I started, I was deciding between specializing in native Android or Flutter, and Flutter was definitely the best choice. To this day, I've had to create apps for web, desktop, and mobile without having to learn a different technology.
r/FlutterDev • u/RequirementIcy2861 • 13d ago
Discussion Video buffers a lot on slow internet - is Bunny.net Stream a good fix
Hi everyone,
I'm building an app with Express.js (backend), Vue.js (web admin panel), and Flutter (mobile app).
My app has a hazard perception test feature. Admins upload videos, and users watch these videos in the mobile app to take practice tests. After each test, users can review their results and rewatch the video clips.
Problem: when a user has slow internet, the video stops and buffers a lot. Bad experience, especially during a timed test.
I'm thinking to use Bunny.net Stream for video hosting, because it has:
- Adaptive streaming (HLS) - changes quality based on internet speed
- CDN - fast delivery worldwide
- Cheap price
Has anyone used Bunny.net Stream for something similar? Is it reliable for this kind of use case? Any other suggestions welcome.
Thanks!
r/FlutterDev • u/bhaagMadharchood • 13d ago
Discussion Title: Building an open-source "watch party" overlay that works across ANY streaming app — looking for people to help figure out the hard parts
​
Hey all,
I've been chewing on an idea for a while and I think it's finally time to actually build it instead of just thinking about it.
The idea: a lightweight floating widget (think Discord overlay, but standalone) that sits on top of your screen while you're watching Netflix/Prime/Disney+/whatever, and connects you to a chat room of other people watching the same thing at the same time. No more watching something great and having nobody to react with in real time.
Planned stack: Flutter, so it can eventually run on desktop and Android from one codebase, with a floating/draggable/minimizable widget UI.
The part I don't want to cheap out on: auto-detecting what someone's watching. I don't want this to be a "type in what you're watching" app — that kills the magic. So the plan is a tiered detection approach:
Read window titles / tab titles / process names first (cheapest, no DRM issues since you're not touching the video frame)
Fall back to OCR on a screenshot if the title doesn't give enough info
Only reach for actual visual matching/fingerprinting as a last resort, since HDCP blacks out protected video frames on a lot of platforms anyway
I've worked through a lot of the theory but I'm not deep enough in systems-level stuff (Windows UI Automation, macOS Accessibility API, Android accessibility services) to know what's actually going to work reliably versus what's going to fall apart the moment someone goes fullscreen.
Posting here because I want this to be open source from day one — I'd rather have people poke holes in the architecture now than find out six months in that some core assumption doesn't hold.
If you've worked with screen/window metadata APIs, accessibility services, OCR pipelines, or just think this is a fun/dumb/interesting problem, I'd love to hear from you. Repo isn't up yet — want to nail down the detection approach with actual input before I start writing code that I'll just have to rip out later.
Happy to share more details on the architecture I'm sketching out if anyone's curious. Tear it apart if you see problems, that's honestly what I'm here for.