dvHomeWidgetDataKey function

String dvHomeWidgetDataKey(
  1. String id
)

Where a home widget's data is left for the surface that draws it.

This is the whole of what "shares state with the parent app" can mean once the boundary is honest about itself. A home widget is composed in the launcher's process on Android and by the system on iOS and macOS, and neither can host a Flutter engine, so the widget tree and its state are shared with the application at /widgets/<id> -- the application's own tree, its own signals, its own globals -- and what crosses to the home screen is a value under a key.

In core because three halves need it and they are in three languages: the Dart runtime writes it, the generated Swift reads it out of the App Group defaults, and the generated Java reads it out of the shared store. A key with two spellings is a correctly built, correctly signed widget showing its placeholder for ever, with nothing to see at any end.

Implementation

String dvHomeWidgetDataKey(String id) =>
    'dartvel.widget.text.${dvHomeWidgetPlatformName(id)}';