mosaic_widgets 0.3.0
mosaic_widgets: ^0.3.0 copied to clipboard
Build native iOS and Android home-screen widgets, lock-screen widgets, and Live Activities from a single Flutter-style Dart DSL.
Changelog #
0.3.0 - 2026-08-04 #
Added #
MRaw(swift:, androidXml:, binds:)— verbatim native code. Your SwiftUI or layout XML is inserted unchanged while Mosaic still generates the App Group wiring, timeline and update path. Removes the DSL's ceiling: what the vocabulary cannot express, you can now hand-write. Declare the bind keys — the generator cannot parse a snippet, so an undeclared key is never fetched.MAdaptive(ios:, android:)— a different subtree per platform, chosen at generation time. For the cases the DSL already documents as divergent:MFlipperrenders one child on iOS,MActivityIndicatoranimates only on Android,MFlexibleratios hold only on Android.MBind(defaultValue:)— what renders before the app first writes. Seeds the iOSplaceholder(in:), which the OS shows in the widget gallery before your app has ever run; it previously shipped an empty dictionary, so every bound value previewed as--.MTextRole— semantic type scale (title … captionSmall)..headlineon iOS, a matching sp on Android; the roles line up, the sizes deliberately do not.MTextStyle:weight(MFontWeight.w100–w900),italic,copyWith, andbaseStyle. iOS honours all nine weights; Android collapses w200/w600/w800 becausetextFontWeightis API 28 against a floor of 21.MosaicBridge.initialDeepLink()— the tap that launched the app.
Fixed #
- A widget tap that cold-launched the app could be lost entirely.
onDeepLinkis a broadcast stream and the native side delivers during registration, so the link arrived before anything could subscribe and the app opened on its default screen. MosaicTv.publishreported success on devices with no TV provider — a phone claimed to have published a row that was never written.
0.2.0 - 2026-08-02 #
Added #
MosaicBridge.getValue<T>— read the shared store back. The widget writes to it too (anMToggleActionflips its bool on-device), and none of that was visible to the app before.MosaicBridge.saveFile/saveImage— put a file whereMFileImagecan find it. The node was documented but unusable without this.MosaicBridge.renderFlutterWidget— rasterise any Flutter widget to a PNG, the escape hatch for what the DSL cannot express.MosaicBridge.installedWidgets()— which widgets the user actually placed.MosaicTv+tv_channels:— Android TV / Google TV home-screen channels. Not widgets: the TV launchers host no AppWidgets at all.- macOS and watchOS: the generated Swift now compiles for both, including
watch complications and the watchOS-only
accessoryCornerfamily.
Fixed #
MPositionedignored its offsets on iOS, so every decorative element sat flush to its corner.MListViewwas always empty on iOS:saveListJSON-encodes, and the generator cast straight to an array.- Battery never resolved on iOS —
isBatteryMonitoringEnabledis a no-op in an app extension, so the app publishes it instead.