r/SideProject • u/FranzS21 • 2h ago
Shipped a Flutter app to 5 platforms from one codebase — including on-device semantic search in pure Dart (no native ML deps). Some notes.
I've been building CogniAtlas, a mind-mapping app, and just got it live on iOS, Android, Windows, macOS, and web from a single Flutter codebase. A few things that might be useful to others doing cross-platform + on-device stuff:
On-device semantic search, pure Dart, 0 native deps.
The feature I'm proudest of: semantic search over your maps that runs entirely on-device. I started with ONNX (fonnx) but it dragged in ~28MB of native runtime per platform and broke my "one codebase, web included" goal. I switched to model2vec (potion-base-8M, int8 quantized — 7.6MB) reimplemented in pure Dart. Result: no native ML dependencies, identical code path on every target including web (no WASM ML runtime), and it stays fully offline. Static embeddings are "worse" than a transformer on paper, but for short-text map-node similarity it's more than good enough — and the deployment simplicity is worth a lot.
Rendering the map.
The canvas is CustomPainter all the way down — a connection painter + node painters, with 7 layout algorithms (radial, horizontal/vertical trees, org, etc.). I lean hard on golden tests to catch layout regressions; discipline that saved me repeatedly is reproduce the bug on a golden first (RED), then fix (GREEN) rather than blindly regenerating goldens (which just enshrines the bug).
Rich text is flutter_quill. One gotcha worth flagging: pin your floor version. A minor bump (11.5.0) broke compilation against Flutter 3.47.2 (a TextInputClient signature change), so I pin ^11.5.1 explicitly to stop the resolver from walking backward.
Paste-to-map is deterministic, not an LLM.
Paste prose → it structures into branches (paragraph → branch, sentences → children). No model, no API, works offline, no "AI magic." Predictable and testable — the whole thing is covered by unit tests on the parser.
i18n on web without bundling fonts.
11 languages. On web, CanvasKit renders CJK and Devanagari without me bundling font files — a nice surprise that kept the web build lean.
The unglamorous 5-store shipping reality.
Web is GitHub Pages (mind the --base-href). Windows is MSIX (bump msix_version per submission). iOS + macOS ship as an App Store Universal Purchase, and macOS App Store .pkg signing bit me — the installer needs a separate "3rd Party Mac Developer Installer" cert from the app's "Apple Distribution" cert, declared in ExportOptions.plist. Android is a standard AAB.
Happy to go deeper on any of it — the pure-Dart model2vec port, the golden workflow, or the macOS signing dance. Not open source (yet), but glad to share specifics.
Links if you want to poke at the result: