r/FlutterDev • u/anidotnet • Sep 05 '26
Discussion I shipped a Flutter desktop app to macOS, Windows and Linux — including both arm64 targets. Here's what broke.
I spent the last few weeks building Kruftle, a desktop app that reclaims disk space from build artifacts. It's free, GPL-3.0, and it's Flutter on all three desktop platforms. Sharing the sharp edges, because I couldn't find most of these written down anywhere.
Flutter ships no arm64 SDK for Windows or Linux. Only macOS gets both in the release manifest, so subosito/flutter-action fails outright on an arm64 runner with "Unable to determine Flutter version". The fix is to clone the SDK at the pinned tag and let it bootstrap its own Dart SDK and engine artifacts — dartsdk-linux-arm64 and dartsdk-windows-arm64 do both exist. All five build jobs are green now, both arm64 ones included.
statvfs on macOS counts blocks in 32 bits, which overflows on a large volume. macOS needs statfs, whose counts are 64-bit. Linux is fine with statvfs. The two structs disagree on where the block size lives and how wide it is, which was a fun afternoon over dart:ffi.
Inside an AppImage, Platform.resolvedExecutable has a shelf life. The payload is mounted under /tmp/.mount_XXXXXX and unmounted the moment the process exits, so any path you write down for later — a systemd unit, a desktop entry — is dead on arrival. $APPIMAGE is the one that survives.
pumpAndSettle never returns against a repeating animation, and toByteData never completes inside a widget test — PNG encoding runs on the real event loop, which the tester's fake one doesn't advance, so the future just hangs until the ten-minute suite timeout with no error. Wrap it in tester.runAsync.
Translated labels are longer than English ones. German and Russian both overflowed a step rail sized to fit "Review". Any fixed-width chrome needs its label Flexible with an ellipsis, and per-locale widget tests asserting tester.takeException() is null are what catch it.
The app itself scans a folder, works out what every project under it is built with across 42 toolchains, and reclaims the space by running each one's own clean command — cargo clean, flutter clean, ./gradlew clean — rather than rm -rf'ing a guessed directory name. Source and downloads: https://github.com/dizitart/kruftle
Happy to go deeper on any of these.
26
u/claudhigson Sep 06 '26
can't even write a title without AI these days...
6
u/kitanokikori Sep 05 '26
If you pin a super new version of Flutter (beta?), ARM64 Windows builds should just work, afaik this was recently fixed
1
u/aksanabuster Sep 06 '26
A ten-minute timeout 👀👀👀🥴🥴… anyway to add a microtask to watch each async events and optimize test with more data driven/accurate assumptions, by then you’d have more visibility on what’s ensuing UI to be dependent on a static 10-minute execution, idk..
that just caught my eye, but I’m really impressed with your linking of flutter engine in respect to the pubspec.lock of project then mount root/binary-image in respect to the cargo make target linker! I just wonder if a microtask is discrete and is a less aggressive alternative to at least set the StackTrace override fromString method then you can set what you actually want to see.. please tag me if you try this and LMK the tradeoffs, if any..
Good luck and thanks for sharing!
1
u/english_european Sep 06 '26
Claude isn’t the best at wording these types of posts. It’s useful info but worth rewriting in plain English I think! There are even plugins for that now!