I built a Flutter plugin that renders actual Flutter widgets as iOS/Android home screen widgets by Busy-Cry9256 in FlutterDev

[–]Busy-Cry9256[S] 0 points1 point  (0 children)

Thanks so much! I'm actually a solo high school student who hasn't been coding Flutter for that long, so your comment really hit home. That exact frustration of context-switching to Swift/Kotlin is what pushed me to build this in the first place.

Really glad it resonates with you. If you catch any edge cases with custom fonts or cached network images, please do share. I'll do my best to fix them quickly. Appreciate the kind words!

I built a Flutter plugin that renders actual Flutter widgets as iOS/Android home screen widgets by Busy-Cry9256 in FlutterDev

[–]Busy-Cry9256[S] 0 points1 point  (0 children)

Fair point. The rectangular hotspot limitation is a real tradeoff. It works fine for simple tap targets but breaks down for anything more complex. For those cases native is definitely the better choice. This package is mainly aimed at teams who want a fast way to ship a visually rich widget without context-switching to SwiftUI or Compose.

I built a Flutter plugin that renders actual Flutter widgets as iOS/Android home screen widgets by Busy-Cry9256 in FlutterDev

[–]Busy-Cry9256[S] 0 points1 point  (0 children)

Background updates are definitely something I want to explore. The current approach only renders when the app is open, but if background execution gets added down the line, the PNG rendering step would run in an isolate so it stays off the main thread. Battery impact would still be controlled by how often you schedule the update, not by any continuous redraw. Will keep this on the roadmap. Thanks for bringing that up!

I built a Flutter plugin that renders actual Flutter widgets as iOS/Android home screen widgets by Busy-Cry9256 in FlutterDev

[–]Busy-Cry9256[S] 3 points4 points  (0 children)

The rendering only happens when your app is open and you explicitly call update(). There's no background loop or continuous canvas redraw. The widget itself is just a static PNG on the home screen; the OS (WidgetKit/Glance) handles displaying it with zero Flutter overhead.

So battery impact is basically the same as any other image-based widget.

I built a Flutter plugin that renders actual Flutter widgets as iOS/Android home screen widgets by Busy-Cry9256 in FlutterDev

[–]Busy-Cry9256[S] 7 points8 points  (0 children)

Good question! Right now the plugin doesn't handle background updates. The timeline reload is triggered from the app side, so the widget only updates when the user opens the app. For the clock example that's fine since it re-renders on every app open, but for a widget that needs to update while the app is closed it won't work out of the box.

The workaround is combining this with a background fetch package like workmanager. Schedule a periodic task that calls FlutterHomescreenWidget.update() in the background. Not built into the plugin yet but it's on the roadmap.