flutter_secure_storage_watchos 0.0.1
flutter_secure_storage_watchos: ^0.0.1 copied to clipboard
watchOS implementation of the flutter_secure_storage plugin, storing secrets in the Keychain via the SecItem APIs over dart:ffi.
flutter_secure_storage_watchos #
The watchOS implementation of flutter_secure_storage.
Secrets are stored in the watch Keychain (kSecClassGenericPassword),
reached over dart:ffi. The Keychain is fully available on watchOS, so this
behaves like the Apple (iOS/macOS) implementation.
Scaffolded by
flutter-watchos plugin portfromflutter_secure_storage_darwin, then implemented and verified by hand.
Usage #
This is a federated plugin implementation. Apps that already depend on
flutter_secure_storage and target watchOS only need to add this package
alongside it:
dependencies:
flutter_secure_storage: ^<latest>
flutter_secure_storage_watchos: ^0.0.1
The plugin registers automatically via Flutter's federated registry — no explicit imports required from app code.
Behaviour on watchOS #
write,read,containsKey,delete,readAll,deleteAllare all supported, keyed by theaccountNameoption (Keychain service).- The
accessibilityandsynchronizableoptions are honoured;groupId(access group) requires the keychain-access-groups entitlement. - Biometric-gated items are not offered: the watch has no Face ID / Touch ID.
Status #
| Platform | Implemented |
|---|---|
Apple Watch (watchos) |
yes |
Watch simulator (watchsimulator) |
yes |
The Keychain round-trip (read / write / delete / readAll / containsKey) is
verified by the host-side unit tests and the unified demo on the watch
simulator. The example ships flutter_secure_storage's own upstream
integration_test/app_test.dart verbatim; it is a phone-shaped page-object
sweep (tapping a floating action button to add list rows, driving popup menus)
whose widgets a ~200 px watch screen never materialises, so most of its cases
cannot be driven on the watch — a viewport limitation of that test, not of the
Keychain implementation.
Example on the watch screen #
The package ships the upstream example app and its official integration
test verbatim. The upstream UI is phone-designed and does not fit a watch
screen at native density, so the example's runner opts into the
flutter-watchos content scale (watchos/Runner/Info.plist):
<key>FlutterWatchOSContentScale</key>
<real>0.4</real>
This lays the app out in a proportionally larger logical space rendered smaller — same layout, smaller components — without touching the example's Dart code.
License #
The FlutterWatch Authors under a BSD-3-Clause license. See LICENSE for the full text.