MosaicBridge class

Constructors

MosaicBridge()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

Stream of deep links received from widgets.
no setter

Static Methods

canRequestPinWidget() Future<bool>
Whether requestPinWidget can do anything on this device.
getValue<T>(String key, {T? defaultValue}) Future<T?>
Reads a value back out of shared storage.
The deep link that launched the app, if a widget tap did.
installedWidgets() Future<List<MosaicWidgetInfo>>
The widgets the user has actually placed, so an onboarding prompt can stop nagging once one exists.
refresh(String widgetName) Future<void>
Triggers a refresh of a specific home widget.
refreshAll() Future<void>
Triggers a refresh of all home widgets.
registerBackgroundCallback(Future<void> callback(String widgetName)) → void
Registers a top-level function to handle background events from widgets.
renderFlutterWidget(Widget widget, {required String key, Size logicalSize = const Size(300, 300), double? pixelRatio}) Future<String?>
Rasterises an arbitrary Flutter widget to a PNG in shared storage and returns its path, for display through MFileImage.
requestPinWidget(String widgetName) Future<bool>
Asks the launcher to show its "add widget" dialog for widgetName, letting a user place a widget without leaving your app.
saveBool(String key, bool value) Future<void>
Saves a boolean value to shared storage.
saveFile(String key, Uint8List bytes, {String extension = 'png'}) Future<String?>
Writes bytes into shared storage and returns the absolute path.
saveImage(String key, ImageProvider<Object> provider, {ImageConfiguration configuration = ImageConfiguration.empty}) Future<String?>
Encodes provider as a PNG in shared storage and returns its path.
saveJson(String key, Map<String, dynamic> value) Future<void>
Saves a JSON map to shared storage.
saveList(String key, List value) Future<void>
Saves a list to shared storage.
saveString(String key, String value) Future<void>
Saves a string value to shared storage.
setAppGroupId(String groupId) Future<void>
Sets the App Group ID for iOS data sharing.
widgetPushTokens() Future<Map<String, String>>
The APNs push tokens WidgetKit issued for widgets declaring push: true, keyed by widget name.