flutter_watchos 0.1.0-beta.7
flutter_watchos: ^0.1.0-beta.7 copied to clipboard
Platform detection and utilities for Flutter apps running on Apple Watch (watchOS). Provides runtime checks for watchOS, device info, capability queries, and Taptic Engine haptics.
0.1.0-beta.7 #
- Fix: the package is now Web-safe.
FlutterWatchosPlatformis the guard this package tells cross-platform apps to write instead ofPlatform.isIOS, but it importeddart:iounconditionally, so following that advice broke the app's Web build — anUnsupportedError: Platform._operatingSystemon the firstisWatchread (a compile error on older SDKs). It now resolves through a conditional import: on WebisWatch,isIos, andisAppleMobileare allfalse. - Breaking (Web only):
extension FlutterWatchosPlatformExt on Platformis native-only API now — it extends thedart:ioPlatformtype, which does not exist on Web. Nothing changes for iOS/watchOS/Android/desktop code; Web code that needs the check should use the staticFlutterWatchosPlatformgetters.
0.1.0-beta.6 #
- New:
WatchAlwaysOn/WatchAlwaysOnBuilder— react to the watchOS Always-On display, i.e. the wrist going down and the system showing the app dimmed instead of blanking it. Apps use it to pause animations, hide private content, and drop bright fills, per the watchOS HIG. The state comes from SwiftUI's\.isLuminanceReduced, so unlikeAppLifecycleState.inactiveit does not also fire for notification banners and Control Center.WatchAlwaysOn.isSupportedreports whether the app's watch host reports the state at all (false under a host module built by an older CLI, whereisActivewould read false regardless of the display).
0.1.0-beta.5 #
- New:
WatchPlatformView— embeds a native SwiftUI view at its slot in the Flutter layout. Register a factory perviewTypewithWatchPlatformViewRegistry.registerin the app's runner, then place the widget like any other box.layer:picks the composition side:WatchPlatformViewLayer.aboveFlutter(default) for interactive native controls,belowFlutterto let Flutter content (dialogs, snackbars, badges) draw over the view.WatchPlatformView.isSupportedandisUnderlaySupportedreport engine support; the widget renders nothing on non-watchOS platforms and on engines that predate the feature.
0.1.0-beta.4 #
- Meta: add pub.dev
topicsand adocumentationlink. No API changes.
0.1.0-beta.3 #
- Docs: README now links to the GitHub source/issues and drops a broken relative link. No API changes.
0.1.0-beta.2 #
- Fix: the package now no-ops correctly on iPhone/iPad. The native-symbol
gate used
Platform.isIOS, which is alsotrueon real iOS, so cross-platform apps crashed with "symbol not found" when callingWatchCrown,WatchHaptics,WatchStatusBar,WatchCrownScrolling, orWatchOSInfooff-watch. The gate now checks for an actual watchOS process (Platform.operatingSystem == 'watchos'), so the documented "safe no-op on non-watchOS platforms" behavior holds everywhere: haptics and status-bar calls do nothing, the crown stream never emits,drain()returns 0, andWatchOSInfo.isWatchOSreportsfalse.
0.1.0-beta.1 #
- Initial beta release.
WatchStatusBar— show/hide the system status bar (the clock watchOS draws over every app). Visible by default, per the watchOS HIG; setWatchStatusBar.hidden = truefor immersive UIs.WatchOSInfo— synchronous FFI device info (version, model, machine id, simulator, screen size/scale).FlutterWatchosPlatform— cheapisWatch/isIosplatform detection that disambiguates Apple Watch from iPhone/iPad (both reportPlatform.isIOS).WatchHaptics— Taptic Engine feedback viaWKInterfaceDevice.playHaptic.WatchCrownScroll— the native scroll feel for a subtree: installsWatchScrollPhysics(firm, live, shallow watch-style edge bounce instead of the iPhone deep stretch; no haptic at the list edges, matching native watchOS 26).WatchScrollPhysics/WatchScrollBehavior— the watch-tuned physics on their own, per scrollable or app-wide.WatchCrownScrolling— the native-parity crown scroll options:sensitivity(low/medium/high) anddetentHapticson/off, applied by the engine per crown sample.WatchCrown— raw Digital Crown input (rotation stream or per-framedrain()) for games and custom controls, switching the crown out of scroll mode while active.