Install & Configure
Setting the package up has two parts. This page covers the first one: the Dart dependency and the iOS project settings. The second half is the companion watch app.
1. Add the dependency
Section titled “1. Add the dependency”dependencies: flutter: sdk: flutter carp_core: ^latest carp_mobile_sensing: ^latest carp_aware_package: ^latestflutter pub get2. Register the sampling package
Section titled “2. Register the sampling package”import 'package:carp_core/carp_core.dart';import 'package:carp_mobile_sensing/carp_mobile_sensing.dart';import 'package:carp_aware_package/carp_aware_package.dart';
void main() { SamplingPackageRegistry().register(AppleWatchSamplingPackage()); // ... the rest of your app}Registering makes the nine watch measure types available, it
registers the AppleWatchDevice so protocols containing one can be deserialized,
and it hands CAMS the AppleWatchDeviceManager that communicates with the watch.
3. Enable Swift Package Manager
Section titled “3. Enable Swift Package Manager”The AWARE watchOS framework is distributed only through Swift Package Manager. There is no CocoaPods podspec so make sure SwiftPM is enabled:
flutter config --enable-swift-package-managerVerify it took effect:
flutter config --list | grep swift-package-manager# enable-swift-package-manager: true4. Set the iOS deployment target to 16.0
Section titled “4. Set the iOS deployment target to 16.0”The AWARE framework requires minimum iOS 16.
The Xcode project
Open
ios/Runner.xcworkspace, select the Runner project → Runner target → General → Minimum Deployments → iOS 16.0. Set it on the project as well as the target if they differ.The Podfile
In
ios/Podfile, uncomment and set the platform line:ios/Podfile platform :ios, '16.0'The Flutter framework plist
In
ios/Flutter/AppFrameworkInfo.plist:ios/Flutter/AppFrameworkInfo.plist <plist version="1.0"><dict>...<key>MinimumOSVersion</key><string>16.0</string></dict></plist>Re-resolve
Terminal window cd ios && pod install && cd ..
5. Generate the SwiftPM package and check it resolved
Section titled “5. Generate the SwiftPM package and check it resolved”flutter build ios --config-onlyopen ios/Runner.xcworkspaceIn the Xcode Project navigator you should now see Package Dependencies →
FlutterGeneratedPluginSwiftPackage, and carp_aware_package under it.
The AWARE framework itself is not listed as a package. Currently it ships with the plugin as pre-compiled binaries.
Android
Section titled “Android”Not supported