flow_widget_watchos
watchOS Complications bridge for flow_widget.
Architecture
watchOS apps are native Watch extensions — Flutter does not run on Apple Watch. The data flow is:
Flutter (iOS host) → App Group storage → Watch extension → Complications
- The paired iPhone app uses
FlowWidgetWatchOs(orflow_widget_ios) to persist typed{t, v}values into a shared App Group. flow_widget_cligenerates a Watch extension target that compiles the Swift sources fromwatchos/in this package.- Complication controllers read
FlowWidgetStorageand reload viaFlowWidgetComplicationController.
Capabilities
| Feature | Supported |
|---|---|
| Complications | Yes |
| Home widgets | No |
| Live Activities | No |
| Direct Flutter on watchOS | No |
Dart usage
import 'package:flow_widget_watchos/flow_widget_watchos.dart';
// Optional: register when building a watch-aware iOS host.
FlowWidgetWatchOs.registerWith();
await FlowWidget.saveData(
key: 'complication.weather',
value: FlowWidgetValue.string('72°F'),
groupId: 'group.dev.flowwidget',
);
getPlatformType returns "watchOs" when the native bridge handles channel
calls from a watch-aware host build.
Swift integration (CLI-generated)
Copy or generate these files into the Watch extension:
FlowWidgetValueCodec.swiftFlowWidgetStorage.swiftFlowWidgetComplicationController.swiftFlowWidgetWatchBridge.swift
In the Watch extension delegate:
FlowWidgetWatchBridge.handleDataUpdate(appGroupId: "group.dev.flowwidget")
Limitations
- No MethodChannel on watchOS itself — communication is via App Group + optional
WCSessionping. - Complication UI must be implemented in native Swift/SwiftUI in the Watch extension; this package provides storage and reload helpers only.
Channels
When used from the iOS host with a watch bridge embedded:
- Method channel:
dev.flow_widget/methods - Event channel:
dev.flow_widget/events