diff --git a/.github/workflows/create_release_on_tag.yml b/.github/workflows/create_release_on_tag.yml
index 61407422..c1cf0c60 100644
--- a/.github/workflows/create_release_on_tag.yml
+++ b/.github/workflows/create_release_on_tag.yml
@@ -10,15 +10,18 @@ jobs:
name: Create Release and Upload APK
runs-on: ubuntu-latest
steps:
- - name: Checkout code
- uses: actions/checkout@master
-
- - name: Set up JDK 1.8
- uses: actions/setup-java@v4
+ - uses: actions/checkout@v4
+ - uses: actions/setup-java@v4
with:
distribution: 'adopt' # See 'Supported distributions' for available options
java-version: '17'
+ # - name: Set up JDK 17
+ # uses: actions/setup-java@v4
+ # with:
+ # distribution: 'adopt' # See 'Supported distributions' for available options
+ # java-version: '17'
+
- name: Cache Flutter
id: cache-flutter
uses: actions/cache@v3
@@ -28,6 +31,16 @@ jobs:
~/.pub-cache
key: flutter-${{ hashFiles('**/pubspec.lock') }}
+ - name: Cache Gradle
+ id: cache-gradle
+ uses: actions/cache@v3
+ with:
+ path: |
+ ~/.gradle/caches
+ ~/.gradle/wrapper/
+ key: gradle-ubuntu-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
+
+
- if: ${{ steps.cache-flutter.outputs.cache-hit != 'true' }}
name: Install Flutter
run: git clone https://github.com/flutter/flutter.git --depth 1 -b stable $FOLDER
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1760de8a..80549beb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,12 @@
+## 4.2.0
+
+* moving to carp_themes_package instead of research package themes
+* partially transitioning from pods to spm
+* health connect flow update
+* informed consent accepted is now checked via API instead of local settings
+* fixing hasSeenBluetoothInstructions bool logic
+* small UI changes
+
## 4.1.1
- small visual fixes
diff --git a/android/app/build.gradle b/android/app/build.gradle
index e70b25af..bc2192c5 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -5,7 +5,7 @@ plugins {
}
def localProperties = new Properties()
-def localPropertiesFile = rootProject.file('local.properties')
+def localPropertiesFile = project.rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
@@ -13,7 +13,7 @@ if (localPropertiesFile.exists()) {
}
def keyProperties = new Properties()
-def keyPropertiesFile = rootProject.file('key.properties')
+def keyPropertiesFile = project.rootProject.file('key.properties')
def signingConfigExists = false
if (keyPropertiesFile.exists()) {
@@ -23,15 +23,8 @@ if (keyPropertiesFile.exists()) {
}
}
-def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
-if (flutterVersionCode == null) {
- flutterVersionCode = '1'
-}
-
-def flutterVersionName = localProperties.getProperty('flutter.versionName')
-if (flutterVersionName == null) {
- flutterVersionName = '1.0'
-}
+def flutterVersionCode = localProperties.getProperty('flutter.versionCode') ?: '1'
+def flutterVersionName = localProperties.getProperty('flutter.versionName') ?: '1.0'
android {
namespace "dk.carp.studies_app"
@@ -88,10 +81,10 @@ android {
debugSymbolLevel 'SYMBOL_TABLE'
}
if (signingConfigExists) {
- logger.error('storeFile found, signing with release build.')
+ logger.info('storeFile found, signing with release build.')
signingConfig signingConfigs.release
} else {
- logger.error('No storeFile found or null. Skipping signing of release build.')
+ logger.info('No storeFile found or null. Skipping signing of release build.')
signingConfig signingConfigs.debug
}
}
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 303b83a4..0356ad36 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -212,29 +212,6 @@
-->
-
-
-
-
-
-
-
-
-
-
-
'https://bitbucket.org/movesense/movesense-mobile-lib/'
- pod 'PhoneNumberKit', '~> 3.7'
+ # pod 'PhoneNumberKit', '~> 3.7'
end
post_install do |installer|
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index a1758e56..087ce02c 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -1,52 +1,21 @@
PODS:
- - AppAuth (2.0.0):
- - AppAuth/Core (= 2.0.0)
- - AppAuth/ExternalUserAgent (= 2.0.0)
- - AppAuth/Core (2.0.0)
- - AppAuth/ExternalUserAgent (2.0.0):
- - AppAuth/Core
- - "appcheck (1.5.4+1)":
- - Flutter
- - audio_session (0.0.1):
- - Flutter
- audio_streamer (0.0.1):
- Flutter
- - battery_plus (1.0.0):
- - Flutter
- - camera_avfoundation (0.0.1):
- - Flutter
- - connectivity_plus (0.0.1):
- - Flutter
- dchs_flutter_beacon (0.6.5):
- Flutter
- - device_info_plus (0.0.1):
- - Flutter
- Flutter (1.0.0)
- flutter_activity_recognition (0.0.1):
- Flutter
- - flutter_appauth (0.0.1):
- - AppAuth (= 2.0.0)
- - Flutter
- - flutter_blue_plus_darwin (0.0.2):
- - Flutter
- - FlutterMacOS
- - flutter_local_notifications (0.0.1):
- - Flutter
- flutter_secure_storage (6.0.0):
- Flutter
- flutter_sound (9.28.0):
- Flutter
- flutter_sound_core (= 9.28.0)
- flutter_sound_core (9.28.0)
- - flutter_timezone (0.0.1):
- - Flutter
- flutter_web_auth_2 (3.0.0):
- Flutter
- health (12.2.1):
- Flutter
- - just_audio (0.0.1):
- - Flutter
- - FlutterMacOS
- location (0.0.1):
- Flutter
- mdsflutter (0.0.1):
@@ -55,27 +24,14 @@ PODS:
- SwiftProtobuf
- Movesense (3.33.1)
- MTBBarcodeScanner (5.0.11)
- - network_info_plus (0.0.1):
- - Flutter
- oidc_ios (0.0.1):
- Flutter
- open_settings_plus (0.0.1):
- Flutter
- - package_info_plus (0.4.5):
- - Flutter
- - path_provider_foundation (0.0.1):
- - Flutter
- - FlutterMacOS
- pedometer (0.0.1):
- Flutter
- permission_handler_apple (9.3.0):
- Flutter
- - PhoneNumberKit (3.8.0):
- - PhoneNumberKit/PhoneNumberKitCore (= 3.8.0)
- - PhoneNumberKit/UIKit (= 3.8.0)
- - PhoneNumberKit/PhoneNumberKitCore (3.8.0)
- - PhoneNumberKit/UIKit (3.8.0):
- - PhoneNumberKit/PhoneNumberKitCore
- polar (0.0.1):
- Flutter
- PolarBleSdk (~> 6.1.0)
@@ -89,128 +45,65 @@ PODS:
- RxSwift (6.8.0)
- screen_state (1.0.0):
- Flutter
- - sensors_plus (0.0.1):
- - Flutter
- - shared_preferences_foundation (0.0.1):
- - Flutter
- - FlutterMacOS
- - sqflite_darwin (0.0.4):
- - Flutter
- - FlutterMacOS
- - SwiftProtobuf (1.31.1)
- - url_launcher_ios (0.0.1):
- - Flutter
- - video_player_avfoundation (0.0.1):
- - Flutter
- - FlutterMacOS
+ - SwiftProtobuf (1.33.3)
- Zip (2.1.2)
DEPENDENCIES:
- - appcheck (from `.symlinks/plugins/appcheck/ios`)
- - audio_session (from `.symlinks/plugins/audio_session/ios`)
- audio_streamer (from `.symlinks/plugins/audio_streamer/ios`)
- - battery_plus (from `.symlinks/plugins/battery_plus/ios`)
- - camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
- - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- dchs_flutter_beacon (from `.symlinks/plugins/dchs_flutter_beacon/ios`)
- - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- Flutter (from `Flutter`)
- flutter_activity_recognition (from `.symlinks/plugins/flutter_activity_recognition/ios`)
- - flutter_appauth (from `.symlinks/plugins/flutter_appauth/ios`)
- - flutter_blue_plus_darwin (from `.symlinks/plugins/flutter_blue_plus_darwin/darwin`)
- - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- flutter_sound (from `.symlinks/plugins/flutter_sound/ios`)
- - flutter_timezone (from `.symlinks/plugins/flutter_timezone/ios`)
- flutter_web_auth_2 (from `.symlinks/plugins/flutter_web_auth_2/ios`)
- health (from `.symlinks/plugins/health/ios`)
- - just_audio (from `.symlinks/plugins/just_audio/darwin`)
- location (from `.symlinks/plugins/location/ios`)
- mdsflutter (from `.symlinks/plugins/mdsflutter/ios`)
- Movesense (from `https://bitbucket.org/movesense/movesense-mobile-lib/`)
- - network_info_plus (from `.symlinks/plugins/network_info_plus/ios`)
- oidc_ios (from `.symlinks/plugins/oidc_ios/ios`)
- open_settings_plus (from `.symlinks/plugins/open_settings_plus/ios`)
- - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- pedometer (from `.symlinks/plugins/pedometer/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- - PhoneNumberKit (~> 3.7)
- polar (from `.symlinks/plugins/polar/ios`)
- qr_code_scanner_plus (from `.symlinks/plugins/qr_code_scanner_plus/ios`)
- screen_state (from `.symlinks/plugins/screen_state/ios`)
- - sensors_plus (from `.symlinks/plugins/sensors_plus/ios`)
- - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- - sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
- - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
SPEC REPOS:
trunk:
- - AppAuth
- flutter_sound_core
- MTBBarcodeScanner
- - PhoneNumberKit
- PolarBleSdk
- RxSwift
- SwiftProtobuf
- Zip
EXTERNAL SOURCES:
- appcheck:
- :path: ".symlinks/plugins/appcheck/ios"
- audio_session:
- :path: ".symlinks/plugins/audio_session/ios"
audio_streamer:
:path: ".symlinks/plugins/audio_streamer/ios"
- battery_plus:
- :path: ".symlinks/plugins/battery_plus/ios"
- camera_avfoundation:
- :path: ".symlinks/plugins/camera_avfoundation/ios"
- connectivity_plus:
- :path: ".symlinks/plugins/connectivity_plus/ios"
dchs_flutter_beacon:
:path: ".symlinks/plugins/dchs_flutter_beacon/ios"
- device_info_plus:
- :path: ".symlinks/plugins/device_info_plus/ios"
Flutter:
:path: Flutter
flutter_activity_recognition:
:path: ".symlinks/plugins/flutter_activity_recognition/ios"
- flutter_appauth:
- :path: ".symlinks/plugins/flutter_appauth/ios"
- flutter_blue_plus_darwin:
- :path: ".symlinks/plugins/flutter_blue_plus_darwin/darwin"
- flutter_local_notifications:
- :path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
flutter_sound:
:path: ".symlinks/plugins/flutter_sound/ios"
- flutter_timezone:
- :path: ".symlinks/plugins/flutter_timezone/ios"
flutter_web_auth_2:
:path: ".symlinks/plugins/flutter_web_auth_2/ios"
health:
:path: ".symlinks/plugins/health/ios"
- just_audio:
- :path: ".symlinks/plugins/just_audio/darwin"
location:
:path: ".symlinks/plugins/location/ios"
mdsflutter:
:path: ".symlinks/plugins/mdsflutter/ios"
Movesense:
:git: https://bitbucket.org/movesense/movesense-mobile-lib/
- network_info_plus:
- :path: ".symlinks/plugins/network_info_plus/ios"
oidc_ios:
:path: ".symlinks/plugins/oidc_ios/ios"
open_settings_plus:
:path: ".symlinks/plugins/open_settings_plus/ios"
- package_info_plus:
- :path: ".symlinks/plugins/package_info_plus/ios"
- path_provider_foundation:
- :path: ".symlinks/plugins/path_provider_foundation/darwin"
pedometer:
:path: ".symlinks/plugins/pedometer/ios"
permission_handler_apple:
@@ -221,16 +114,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/qr_code_scanner_plus/ios"
screen_state:
:path: ".symlinks/plugins/screen_state/ios"
- sensors_plus:
- :path: ".symlinks/plugins/sensors_plus/ios"
- shared_preferences_foundation:
- :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
- sqflite_darwin:
- :path: ".symlinks/plugins/sqflite_darwin/darwin"
- url_launcher_ios:
- :path: ".symlinks/plugins/url_launcher_ios/ios"
- video_player_avfoundation:
- :path: ".symlinks/plugins/video_player_avfoundation/darwin"
CHECKOUT OPTIONS:
Movesense:
@@ -238,52 +121,31 @@ CHECKOUT OPTIONS:
:git: https://bitbucket.org/movesense/movesense-mobile-lib/
SPEC CHECKSUMS:
- AppAuth: 1c1a8afa7e12f2ec3a294d9882dfa5ab7d3cb063
- appcheck: 3c94d0ffc94bd639938cac7427d5b13df2795404
- audio_session: 9bb7f6c970f21241b19f5a3658097ae459681ba0
audio_streamer: 2e472b9f81cec5e381c4cf7667afa3055dcb45a4
- battery_plus: b42253f6d2dde71712f8c36fef456d99121c5977
- camera_avfoundation: 5675ca25298b6f81fa0a325188e7df62cc217741
- connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
dchs_flutter_beacon: 88d72cc467de508d621e454ea66c6231d0897d4c
- device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_activity_recognition: 52dfad4c1e9cec99f0841b3ed0efcc9d424b3deb
- flutter_appauth: d4abcf54856e5d8ba82ed7646ffc83245d4aa448
- flutter_blue_plus_darwin: 20a08bfeaa0f7804d524858d3d8744bcc1b6dbc3
- flutter_local_notifications: a5a732f069baa862e728d839dd2ebb904737effb
flutter_secure_storage: 1ed9476fba7e7a782b22888f956cce43e2c62f13
flutter_sound: b9236a5875299aaa4cef1690afd2f01d52a3f890
flutter_sound_core: 427465f72d07ab8c3edbe8ffdde709ddacd3763c
- flutter_timezone: 7c838e17ffd4645d261e87037e5bebf6d38fe544
flutter_web_auth_2: 5c8d9dcd7848b5a9efb086d24e7a9adcae979c80
health: fe206e65f13a9b88623605fbd8af8f029e23dc35
- just_audio: 4e391f57b79cad2b0674030a00453ca5ce817eed
location: 155caecf9da4f280ab5fe4a55f94ceccfab838f8
mdsflutter: bd3c0b3335d50947d1a192cf70f930e0fb04a766
Movesense: dc64047c1feb856b7f7ac6ea2c67685350d99dd5
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
- network_info_plus: cf61925ab5205dce05a4f0895989afdb6aade5fc
oidc_ios: 16966cad509ce6850ca4ca1216c5138bef2a8726
open_settings_plus: d19f91e8a04649358a51c19b484ce2e637149d70
- package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
- path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
pedometer: 1c5eaab0c6bce8eb7651f7095553b5081c9d06ed
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
- PhoneNumberKit: ec00ab8cef5342c1dc49fadb99d23fa7e66cf0ef
polar: 0374f6063ade7e2dd85d626f87cbe2393d3eda7c
PolarBleSdk: bfb57cf8350f0c53d441b8632ba6df363ce7c79f
qr_code_scanner_plus: 7e087021bc69873140e0754750eb87d867bed755
RxSwift: 4e28be97cbcfeee614af26d83415febbf2bf6f45
screen_state: 52d6e997d31bddba6417c60d9cdd22effd0320a7
- sensors_plus: 6a11ed0c2e1d0bd0b20b4029d3bad27d96e0c65b
- shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
- sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
- SwiftProtobuf: e02f51c8c2df5845657aee2d4de9d61bf50ef788
- url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
- video_player_avfoundation: dd410b52df6d2466a42d28550e33e4146928280a
+ SwiftProtobuf: e1b437c8e31a4c5577b643249a0bb62ed4f02153
Zip: b3fef584b147b6e582b2256a9815c897d60ddc67
-PODFILE CHECKSUM: 0f233b2493d660073cf18073d2b24e7b319ab4a8
+PODFILE CHECKSUM: 45842edf150243fea66883d4dfad1e5ddb428147
COCOAPODS: 1.16.2
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 516f6216..d1a2b803 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -8,9 +8,11 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
+ 1DF7245C2EC76C6800F24410 /* PhoneNumberKit in Frameworks */ = {isa = PBXBuildFile; productRef = 1DF7245B2EC76C6800F24410 /* PhoneNumberKit */; };
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
+ 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -53,6 +55,7 @@
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
@@ -78,6 +81,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 1DF7245C2EC76C6800F24410 /* PhoneNumberKit in Frameworks */,
+ 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
D93ECDADCF301D48CCE6DCE8 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -106,6 +111,7 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
+ 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
@@ -199,6 +205,10 @@
dependencies = (
);
name = Runner;
+ packageProductDependencies = (
+ 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
+ 1DF7245B2EC76C6800F24410 /* PhoneNumberKit */,
+ );
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
@@ -233,6 +243,10 @@
da,
);
mainGroup = 97C146E51CF9000F007C117D;
+ packageReferences = (
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
+ 1DF7245A2EC76C6800F24410 /* XCRemoteSwiftPackageReference "PhoneNumberKit" */,
+ );
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -734,6 +748,36 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
+
+/* Begin XCLocalSwiftPackageReference section */
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
+ isa = XCLocalSwiftPackageReference;
+ relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCLocalSwiftPackageReference section */
+
+/* Begin XCRemoteSwiftPackageReference section */
+ 1DF7245A2EC76C6800F24410 /* XCRemoteSwiftPackageReference "PhoneNumberKit" */ = {
+ isa = XCRemoteSwiftPackageReference;
+ repositoryURL = "https://github.com/marmelroy/PhoneNumberKit.git";
+ requirement = {
+ kind = upToNextMajorVersion;
+ minimumVersion = 3.6.0;
+ };
+ };
+/* End XCRemoteSwiftPackageReference section */
+
+/* Begin XCSwiftPackageProductDependency section */
+ 1DF7245B2EC76C6800F24410 /* PhoneNumberKit */ = {
+ isa = XCSwiftPackageProductDependency;
+ package = 1DF7245A2EC76C6800F24410 /* XCRemoteSwiftPackageReference "PhoneNumberKit" */;
+ productName = PhoneNumberKit;
+ };
+ 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
+ isa = XCSwiftPackageProductDependency;
+ productName = FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
new file mode 100644
index 00000000..7f1c67b8
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -0,0 +1,23 @@
+{
+ "pins" : [
+ {
+ "identity" : "appauth-ios",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/openid/AppAuth-iOS",
+ "state" : {
+ "revision" : "145104f5ea9d58ae21b60add007c33c1cc0c948e",
+ "version" : "2.0.0"
+ }
+ },
+ {
+ "identity" : "phonenumberkit",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/marmelroy/PhoneNumberKit.git",
+ "state" : {
+ "revision" : "c107075aa8d394be7aced273a46e944afe8b321b",
+ "version" : "3.8.0"
+ }
+ }
+ ],
+ "version" : 2
+}
diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index fa4cdb69..e596a992 100644
--- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -5,6 +5,24 @@
+
+
+
+
+
+
+
+
+
+
UIViewControllerBasedStatusBarAppearance
- UIStatusBarHidden
-
diff --git a/lib/blocs/app_bloc.dart b/lib/blocs/app_bloc.dart
index 18eca055..3fd87f5c 100644
--- a/lib/blocs/app_bloc.dart
+++ b/lib/blocs/app_bloc.dart
@@ -352,7 +352,9 @@ class StudyAppBLoC extends ChangeNotifier {
/// Has the informed consent been accepted by the user?
bool get hasInformedConsentBeenAccepted =>
- LocalSettings().participant?.hasInformedConsentBeenAccepted ?? false;
+ backend.getInformedConsentByRole(
+ study!.studyDeploymentId, study!.participantRoleName) !=
+ null;
set hasInformedConsentBeenAccepted(bool accepted) {
var participant = LocalSettings().participant;
@@ -380,6 +382,7 @@ class StudyAppBLoC extends ChangeNotifier {
/// the Study Page of the app.
Future refreshMessages() async {
try {
+ _messages.clear();
_messages = await messageManager.getMessages();
_messages.sort((m1, m2) => m2.timestamp.compareTo(m1.timestamp));
info('Message list refreshed - count: ${_messages.length}');
@@ -478,14 +481,13 @@ class StudyAppBLoC extends ChangeNotifier {
/// * resetting the informed consent flow
/// * returning the user to select an invitation for another study
///
- /// Note that study deployment information and data is not removed from the
- /// phone. This is stored for later access. Or if the same deployment is
- /// re-deployed on the phone, data from the previous deployment will be
- /// available.
+ /// Note that study deployment information and data is removed from the
+ /// phone. If the same deployment is re-deployed on the phone, data from the
+ /// previous deployment will NOT be available.
Future leaveStudy() async {
- debug('$runtimeType --------- LEAVING STUDY ------------');
+ info('Leaving study $study');
- // save and clear the UI data models
+ // clear the UI data models
appViewModel.clear();
// stop sensing and remove all deployment info
diff --git a/lib/carp_study_app.dart b/lib/carp_study_app.dart
index 296c2360..43ac5389 100644
--- a/lib/carp_study_app.dart
+++ b/lib/carp_study_app.dart
@@ -183,7 +183,14 @@ class CarpStudyAppState extends State {
@override
Widget build(BuildContext context) {
- final carpColors = Theme.of(context).extension();
+ final studyAppColors = Theme.of(context).extension();
+
+ // Apply system overlay style after frame so Theme.of(context) is ready
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
+ statusBarColor: Colors.transparent,
+ ));
+ });
return MaterialApp.router(
scaffoldMessengerKey: bloc.scaffoldKey,
supportedLocales: const [
@@ -211,14 +218,14 @@ class CarpStudyAppState extends State {
return supportedLocales.first; // default to EN
},
locale: bloc.localization?.locale,
- theme: researchPackageTheme.copyWith(
+ theme: carpTheme.copyWith(
extensions: [
- researchPackageTheme.extension()!.copyWith(
- primary: carpColors?.primary,
+ carpTheme.extension()!.copyWith(
+ primary: studyAppColors?.primary,
),
],
),
- darkTheme: researchPackageDarkTheme,
+ darkTheme: carpDarkTheme,
debugShowCheckedModeBanner: true,
routerConfig: _router,
);
diff --git a/lib/data/carp_backend.dart b/lib/data/carp_backend.dart
index 6f100fc3..3db20440 100644
--- a/lib/data/carp_backend.dart
+++ b/lib/data/carp_backend.dart
@@ -232,4 +232,11 @@ class CarpBackend {
return uploadedConsent;
}
+
+ Future? getInformedConsentByRole(
+ String studyDeploymentId, String? role) async {
+ return await CarpParticipationService()
+ .participation(studyDeploymentId)
+ .getInformedConsentByRole(role);
+ }
}
diff --git a/lib/data/local_settings.dart b/lib/data/local_settings.dart
index 086461d5..a5194c1a 100644
--- a/lib/data/local_settings.dart
+++ b/lib/data/local_settings.dart
@@ -14,9 +14,6 @@ class LocalSettings {
/// See https://developer.android.com/health-and-fitness/guides/health-connect/develop/get-started#get-client
static const healthConnectPackageName = 'com.google.android.apps.healthdata';
- bool isExpectedParticipantDataSet = false;
- bool hasUserSeenDeviceConnectionInstructions = false;
-
// Keys for storing in shared preferences
static const String userKey = 'user';
static const String participantKey = 'participant';
@@ -26,8 +23,6 @@ class LocalSettings {
Participant? _participant;
SmartphoneStudy? _study;
- bool hasSeenBluetoothConnectionInstructions = false;
-
static final LocalSettings _instance = LocalSettings._();
factory LocalSettings() => _instance;
LocalSettings._() : super();
@@ -109,11 +104,13 @@ class LocalSettings {
);
}
- bool get hasSeenConnectionInstructions =>
- hasSeenBluetoothConnectionInstructions;
+ bool get hasSeenBluetoothConnectionInstructions =>
+ Settings()
+ .preferences
+ ?.getBool('hasSeenBluetoothConnectionInstructions') ??
+ false;
- set hasSeenConnectionInstructions(bool seen) {
- hasSeenBluetoothConnectionInstructions = seen;
+ set hasSeenBluetoothConnectionInstructions(bool seen) {
Settings().preferences?.setBool(
'hasSeenBluetoothConnectionInstructions',
seen,
diff --git a/lib/main.dart b/lib/main.dart
index 904ffa4f..778eef6e 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -55,6 +55,7 @@ import 'package:cognition_package/cognition_package.dart';
import 'package:carp_health_package/health_package.dart';
// import 'package:health/health.dart';
import 'package:carp_movesense_package/carp_movesense_package.dart';
+import 'package:carp_themes_package/carp_themes_package.dart';
part 'blocs/app_bloc.dart';
part 'blocs/util.dart';
@@ -105,8 +106,7 @@ part 'ui/pages/devices_page.enable_bluetooth_dialog.dart';
part 'ui/pages/devices_page.bluetooth_connection_page.dart';
part 'ui/pages/devices_page.disconnection_dialog.dart';
part 'ui/pages/devices_page.list_title.dart';
-part 'ui/pages/devices_page.health_service_connect1.dart';
-part 'ui/pages/devices_page.health_service_connect2.dart';
+part 'ui/pages/devices_page.health_service_connect.dart';
part 'ui/tasks/audio_task_page.dart';
part 'ui/tasks/audio_page.dart';
diff --git a/lib/ui/cards/activity_card.dart b/lib/ui/cards/activity_card.dart
index 51bb84c8..68fe931f 100644
--- a/lib/ui/cards/activity_card.dart
+++ b/lib/ui/cards/activity_card.dart
@@ -63,7 +63,7 @@ class ActivityCardState extends State {
RPLocalizations locale = RPLocalizations.of(context)!;
return StudiesMaterial(
- backgroundColor: Theme.of(context).extension()!.white!,
+ backgroundColor: Theme.of(context).extension()!.white!,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@@ -72,16 +72,16 @@ class ActivityCardState extends State {
children: [
Text(
'${_walk! + _run! + _cycle!}',
- style: dataVizCardTitleNumber.copyWith(
- color: Theme.of(context).extension()!.grey900!,
+ style: fs28fw700.copyWith(
+ color: Theme.of(context).extension()!.grey900!,
),
),
Padding(
padding: const EdgeInsets.only(left: 4.0),
child: Text(
'${locale.translate('cards.activity.total.min')} ${_getDayName(touchedIndex)}',
- style: dataVizCardTitleText.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs12fw700.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
),
),
@@ -91,8 +91,8 @@ class ActivityCardState extends State {
children: [
Text(
"${widget.model.currentMonth} ${widget.model.startOfWeek} - ${int.parse(widget.model.endOfWeek) < int.parse(widget.model.startOfWeek) ? widget.model.nextMonth : widget.model.currentMonth} ${widget.model.endOfWeek}, ${widget.model.currentYear}",
- style: dataVizCardTitleText.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs12fw700.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
),
Spacer(),
@@ -117,7 +117,7 @@ class ActivityCardState extends State {
children: [
Text(
'$_walk',
- style: dataVizCardBottomNumber.copyWith(
+ style: fs22fw700.copyWith(
color: widget.colors[0],
),
),
@@ -125,9 +125,9 @@ class ActivityCardState extends State {
padding: const EdgeInsets.all(4.0),
child: Text(
locale.translate('cards.activity.walking'),
- style: dataVizCardBottomText.copyWith(
+ style: fs12fw700.copyWith(
color: Theme.of(context)
- .extension()!
+ .extension()!
.grey800),
),
),
@@ -141,7 +141,7 @@ class ActivityCardState extends State {
padding: const EdgeInsets.only(left: 8.0),
child: Text(
'$_run',
- style: dataVizCardBottomNumber.copyWith(
+ style: fs12fw700.copyWith(
color: widget.colors[1],
),
),
@@ -150,9 +150,9 @@ class ActivityCardState extends State {
padding: const EdgeInsets.all(4.0),
child: Text(
locale.translate('cards.activity.running'),
- style: dataVizCardBottomText.copyWith(
+ style: fs12fw700.copyWith(
color: Theme.of(context)
- .extension()!
+ .extension()!
.grey800),
),
),
@@ -165,7 +165,7 @@ class ActivityCardState extends State {
children: [
Text(
'$_cycle',
- style: dataVizCardBottomNumber.copyWith(
+ style: fs22fw700.copyWith(
color: widget.colors[2],
),
),
@@ -173,9 +173,10 @@ class ActivityCardState extends State {
padding: const EdgeInsets.only(left: 4.0),
child: Text(
locale.translate('cards.activity.cycling'),
- style: dataVizCardBottomText.copyWith(
- color:
- Theme.of(context).extension()!.grey800,
+ style: fs12fw700.copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .grey800,
),
),
),
@@ -303,8 +304,8 @@ class ActivityCardState extends State {
value.toInt() % meta.appliedInterval == 0
? value.toInt().toString()
: '',
- style: dataCardRightTitleStyle.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs14ls1.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
),
);
diff --git a/lib/ui/cards/anonymous_card.dart b/lib/ui/cards/anonymous_card.dart
index 1c935295..c135d51a 100644
--- a/lib/ui/cards/anonymous_card.dart
+++ b/lib/ui/cards/anonymous_card.dart
@@ -8,7 +8,7 @@ class AnonymousCard extends StatelessWidget {
RPLocalizations locale = RPLocalizations.of(context)!;
return Card(
- color: Theme.of(context).extension()!.grey50,
+ color: Theme.of(context).extension()!.grey50,
elevation: 0,
margin: const EdgeInsets.all(16.0),
shape: RoundedRectangleBorder(
@@ -45,8 +45,7 @@ class AnonymousCard extends StatelessWidget {
child: Text(
locale.translate('pages.about.anonymous.anonymous'),
maxLines: 2,
- style: aboutCardSubtitleStyle.copyWith(
- color: CACHET.ANONYMOUS),
+ style: fs16fw600.copyWith(color: CACHET.ANONYMOUS),
),
),
],
@@ -56,9 +55,9 @@ class AnonymousCard extends StatelessWidget {
padding: const EdgeInsets.only(left: 16.0),
child: Text(
locale.translate('pages.about.anonymous.message'),
- style: aboutCardSubtitleStyle.copyWith(
+ style: fs16fw600.copyWith(
color: Theme.of(context)
- .extension()!
+ .extension()!
.grey900,
fontSize: 14,
),
diff --git a/lib/ui/cards/distance_card.dart b/lib/ui/cards/distance_card.dart
index 92e06851..857ad3ae 100644
--- a/lib/ui/cards/distance_card.dart
+++ b/lib/ui/cards/distance_card.dart
@@ -33,7 +33,7 @@ class _DistanceCardState extends State {
@override
Widget build(BuildContext context) {
return StudiesMaterial(
- backgroundColor: Theme.of(context).extension()!.white!,
+ backgroundColor: Theme.of(context).extension()!.white!,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@@ -42,16 +42,16 @@ class _DistanceCardState extends State {
children: [
Text(
_distance,
- style: dataVizCardTitleNumber.copyWith(
- color: Theme.of(context).extension()!.grey900!,
+ style: fs28fw700.copyWith(
+ color: Theme.of(context).extension()!.grey900!,
),
),
Padding(
padding: const EdgeInsets.only(left: 4.0),
child: Text(
'km ${_getDayName(touchedIndex)}',
- style: dataVizCardTitleText.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs12fw700.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
),
),
@@ -61,8 +61,8 @@ class _DistanceCardState extends State {
children: [
Text(
"${widget.model.currentMonth} ${widget.model.startOfWeek} - ${int.parse(widget.model.endOfWeek) < int.parse(widget.model.startOfWeek) ? widget.model.nextMonth : widget.model.currentMonth} ${widget.model.endOfWeek}, ${widget.model.currentYear}",
- style: dataVizCardTitleText.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs12fw700.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
),
Spacer(),
@@ -174,8 +174,8 @@ class _DistanceCardState extends State {
value.toInt() % meta.appliedInterval == 0
? value.toInt().toString()
: '',
- style: dataCardRightTitleStyle.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs14ls1.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
),
);
diff --git a/lib/ui/cards/heart_rate_card.dart b/lib/ui/cards/heart_rate_card.dart
index abe6290a..570fc7de 100644
--- a/lib/ui/cards/heart_rate_card.dart
+++ b/lib/ui/cards/heart_rate_card.dart
@@ -42,7 +42,7 @@ class HeartRateCardWidgetState extends State
@override
Widget build(BuildContext context) {
return StudiesMaterial(
- backgroundColor: Theme.of(context).extension()!.white!,
+ backgroundColor: Theme.of(context).extension()!.white!,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@@ -86,7 +86,7 @@ class HeartRateCardWidgetState extends State
min == null || max == null
? '-'
: '${(min.toInt())} - ${(max.toInt())}',
- style: heartRateNumberStyle,
+ style: fs28fw700,
),
),
Padding(
@@ -95,9 +95,9 @@ class HeartRateCardWidgetState extends State
min == null || max == null
? ''
: locale.translate('cards.heartrate.bpm'),
- style: heartRateBPMTextStyle.copyWith(
+ style: fs10fw700.copyWith(
fontSize: 12,
- color: Theme.of(context).extension()!.grey600,
+ color: Theme.of(context).extension()!.grey600,
),
),
),
@@ -122,9 +122,9 @@ class HeartRateCardWidgetState extends State
child: currentHeartRate != null
? Text(
currentHeartRate.toStringAsFixed(0),
- style: heartRateNumberStyle,
+ style: fs28fw700,
)
- : Text('-', style: heartRateNumberStyle),
+ : Text('-', style: fs28fw700),
),
Padding(
padding: const EdgeInsets.only(bottom: 14),
@@ -145,8 +145,9 @@ class HeartRateCardWidgetState extends State
),
Text(
locale.translate('cards.heartrate.bpm'),
- style: heartRateBPMTextStyle.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs10fw700.copyWith(
+ color:
+ Theme.of(context).extension()!.grey600,
),
),
],
@@ -169,7 +170,7 @@ class HeartRateCardWidgetState extends State
enabled: true,
touchTooltipData: BarTouchTooltipData(
fitInsideHorizontally: true,
- // tooltipBgColor: Theme.of(context).primaryColorLight,
+ fitInsideVertically: true,
getTooltipItem: (group, groupIndex, rod, rodIndex) {
return BarTooltipItem(
'',
@@ -210,7 +211,7 @@ class HeartRateCardWidgetState extends State
),
),
],
- heartRateNumberStyle,
+ fs28fw700,
);
},
),
@@ -310,8 +311,8 @@ class HeartRateCardWidgetState extends State
value.toInt() % meta.appliedInterval == 0
? value.toInt().toString()
: '',
- style: dataCardRightTitleStyle.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs14ls1.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
maxLines: 1,
),
diff --git a/lib/ui/cards/media_card.dart b/lib/ui/cards/media_card.dart
index 1fe94b1c..c69d3c0f 100644
--- a/lib/ui/cards/media_card.dart
+++ b/lib/ui/cards/media_card.dart
@@ -19,7 +19,7 @@ class MediaCardWidgetState extends State {
}
return StudiesMaterial(
- backgroundColor: Theme.of(context).extension()!.white!,
+ backgroundColor: Theme.of(context).extension()!.white!,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@@ -34,7 +34,7 @@ class MediaCardWidgetState extends State {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 5),
- Text('$total MEDIA', style: dataCardTitleStyle),
+ Text('$total MEDIA', style: fs16fw400ls1),
Column(
children: widget.modelsList
.asMap()
@@ -47,8 +47,8 @@ class MediaCardWidgetState extends State {
const SizedBox(height: 15),
Text(
'${entry.value.tasksDone} ${locale.translate('cards.${entry.value.taskType}.title')}',
- style: dataCardTitleStyle.copyWith(
- fontSize: 14),
+ style:
+ fs16fw400ls1.copyWith(fontSize: 14),
),
LayoutBuilder(builder:
(BuildContext context,
diff --git a/lib/ui/cards/mobility_card.dart b/lib/ui/cards/mobility_card.dart
index ee506136..20278945 100644
--- a/lib/ui/cards/mobility_card.dart
+++ b/lib/ui/cards/mobility_card.dart
@@ -30,7 +30,7 @@ class _MobilityCardState extends State {
RPLocalizations locale = RPLocalizations.of(context)!;
return StudiesMaterial(
- backgroundColor: Theme.of(context).extension()!.white!,
+ backgroundColor: Theme.of(context).extension()!.white!,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@@ -39,7 +39,7 @@ class _MobilityCardState extends State {
children: [
Text(
'$_homestay%',
- style: dataVizCardTitleNumber.copyWith(
+ style: fs28fw700.copyWith(
color: widget.colors[0],
),
),
@@ -47,8 +47,9 @@ class _MobilityCardState extends State {
padding: const EdgeInsets.only(left: 4.0),
child: Text(
"${locale.translate('cards.mobility.homestay')} ${_getDayName(touchedIndex)}",
- style: dataVizCardTitleText.copyWith(
- color: Theme.of(context).extension()!.grey900!,
+ style: fs12fw700.copyWith(
+ color:
+ Theme.of(context).extension()!.grey900!,
),
),
),
@@ -58,8 +59,8 @@ class _MobilityCardState extends State {
children: [
Text(
"${widget.model.currentMonth} ${widget.model.startOfWeek} - ${int.parse(widget.model.endOfWeek) < int.parse(widget.model.startOfWeek) ? widget.model.nextMonth : widget.model.currentMonth} ${widget.model.endOfWeek}, ${widget.model.currentYear}",
- style: dataVizCardTitleText.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs12fw700.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
),
Spacer(),
@@ -81,7 +82,7 @@ class _MobilityCardState extends State {
children: [
Text(
'$_places',
- style: dataVizCardBottomNumber.copyWith(
+ style: fs22fw700.copyWith(
color: widget.colors[0],
),
),
@@ -89,9 +90,9 @@ class _MobilityCardState extends State {
padding: const EdgeInsets.all(4.0),
child: Text(
locale.translate('cards.mobility.places'),
- style: dataVizCardBottomText.copyWith(
+ style: fs12fw700.copyWith(
color: Theme.of(context)
- .extension()!
+ .extension()!
.grey800),
),
),
@@ -206,8 +207,8 @@ class _MobilityCardState extends State {
value.toInt() % meta.appliedInterval == 0
? value.toInt().toString()
: '',
- style: dataCardRightTitleStyle.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs14ls1.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
),
);
@@ -221,8 +222,8 @@ class _MobilityCardState extends State {
value.toInt() % meta.appliedInterval == 0
? value.toInt().toString()
: '',
- style: dataCardRightTitleStyle.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs14ls1.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
),
);
diff --git a/lib/ui/cards/scoreboard_card.dart b/lib/ui/cards/scoreboard_card.dart
index 7ea6e62d..bcdc706e 100644
--- a/lib/ui/cards/scoreboard_card.dart
+++ b/lib/ui/cards/scoreboard_card.dart
@@ -54,41 +54,41 @@ class ScoreboardPersistentHeaderDelegate
List childrenDays = [
Text(model.daysInStudy.toString(),
- style: scoreNumberStyle.copyWith(
- fontSize: calculateScrollAwareSizing(shrinkOffset,
- scoreNumberStyleSmall.fontSize!, scoreNumberStyle.fontSize!),
- color: Theme.of(context).extension()!.grey900)),
+ style: fs36fw800.copyWith(
+ fontSize: calculateScrollAwareSizing(
+ shrinkOffset, fs20fw800.fontSize!, fs36fw800.fontSize!),
+ color: Theme.of(context).extension()!.grey900)),
if (shrinkOffset < offsetForShrink)
Text(locale.translate('cards.scoreboard.days'),
- style: scoreTextStyle.copyWith(
- color: Theme.of(context).extension()!.grey900)),
+ style: fs12fw700.copyWith(
+ color: Theme.of(context).extension()!.grey900)),
if (shrinkOffset > offsetForShrink)
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(locale.translate('cards.scoreboard.days-short'),
- style: scoreTextStyle.copyWith(
- color: Theme.of(context).extension()!.grey900)),
+ style: fs12fw700.copyWith(
+ color: Theme.of(context).extension()!.grey900)),
)
];
List childrenTasks = [
Text(model.taskCompleted.toString(),
- style: scoreNumberStyle.copyWith(
- fontSize: calculateScrollAwareSizing(shrinkOffset,
- scoreNumberStyleSmall.fontSize!, scoreNumberStyle.fontSize!),
- color: Theme.of(context).extension()!.primary)),
+ style: fs36fw800.copyWith(
+ fontSize: calculateScrollAwareSizing(
+ shrinkOffset, fs20fw800.fontSize!, fs36fw800.fontSize!),
+ color: Theme.of(context).extension()!.primary)),
if (shrinkOffset < offsetForShrink)
Text(locale.translate('cards.scoreboard.tasks'),
- style: scoreTextStyle.copyWith(
- color: Theme.of(context).extension()!.primary)),
+ style: fs12fw700.copyWith(
+ color: Theme.of(context).extension()!.primary)),
if (shrinkOffset > offsetForShrink)
Expanded(
flex: 0,
child: Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(locale.translate('cards.scoreboard.tasks-short'),
- style: scoreTextStyle.copyWith(
- color: Theme.of(context).extension()!.primary)),
+ style: fs12fw700.copyWith(
+ color: Theme.of(context).extension()!.primary)),
),
)
];
@@ -96,7 +96,7 @@ class ScoreboardPersistentHeaderDelegate
return Container(
height: height,
decoration: BoxDecoration(
- color: Theme.of(context).extension()!.white,
+ color: Theme.of(context).extension()!.white,
borderRadius: BorderRadius.circular(8), // Rounded corners
),
child: StreamBuilder(
diff --git a/lib/ui/cards/steps_card.dart b/lib/ui/cards/steps_card.dart
index f8caef84..ffb40e14 100644
--- a/lib/ui/cards/steps_card.dart
+++ b/lib/ui/cards/steps_card.dart
@@ -29,7 +29,7 @@ class StepsCardWidgetState extends State {
RPLocalizations locale = RPLocalizations.of(context)!;
return StudiesMaterial(
- backgroundColor: Theme.of(context).extension()!.white!,
+ backgroundColor: Theme.of(context).extension()!.white!,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@@ -37,17 +37,17 @@ class StepsCardWidgetState extends State {
Row(
children: [
Text(
- '$_step',
- style: dataVizCardTitleNumber.copyWith(
- color: Theme.of(context).extension()!.grey900!,
+ _step > 0 ? '$_step' : '0',
+ style: fs28fw700.copyWith(
+ color: Theme.of(context).extension()!.grey900!,
),
),
Padding(
padding: const EdgeInsets.only(left: 4.0),
child: Text(
'${locale.translate('cards.steps.steps')} ${_getDayName(touchedIndex)}',
- style: dataVizCardTitleText.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs12fw700.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
),
),
@@ -57,8 +57,8 @@ class StepsCardWidgetState extends State {
children: [
Text(
"${widget.model.currentMonth} ${widget.model.startOfWeek} - ${int.parse(widget.model.endOfWeek) < int.parse(widget.model.startOfWeek) ? widget.model.nextMonth : widget.model.currentMonth} ${widget.model.endOfWeek}, ${widget.model.currentYear}",
- style: dataVizCardTitleText.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs12fw700.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
),
Spacer(),
@@ -172,8 +172,8 @@ class StepsCardWidgetState extends State {
value.toInt() % meta.appliedInterval == 0
? value.toInt().toString()
: '',
- style: dataCardRightTitleStyle.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs14ls1.copyWith(
+ color: Theme.of(context).extension()!.grey600,
),
),
);
diff --git a/lib/ui/cards/study_progress_card.dart b/lib/ui/cards/study_progress_card.dart
index c74e4cf6..800b6b46 100644
--- a/lib/ui/cards/study_progress_card.dart
+++ b/lib/ui/cards/study_progress_card.dart
@@ -19,7 +19,7 @@ class StudyProgressCardWidgetState extends State {
widget.model.updateProgress();
return StudiesMaterial(
- backgroundColor: Theme.of(context).extension()!.white!,
+ backgroundColor: Theme.of(context).extension()!.white!,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: StreamBuilder(
@@ -33,7 +33,7 @@ class StudyProgressCardWidgetState extends State {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(locale.translate('cards.study_progress.title'),
- style: dataCardTitleStyle),
+ style: fs16fw400ls1),
],
),
),
diff --git a/lib/ui/cards/survey_card.dart b/lib/ui/cards/survey_card.dart
index 92569b90..579b1b1f 100644
--- a/lib/ui/cards/survey_card.dart
+++ b/lib/ui/cards/survey_card.dart
@@ -21,7 +21,7 @@ class _SurveyCardState extends State {
}
return StudiesMaterial(
- backgroundColor: Theme.of(context).extension()!.white!,
+ backgroundColor: Theme.of(context).extension()!.white!,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@@ -30,7 +30,7 @@ class _SurveyCardState extends State {
Padding(
padding: const EdgeInsets.only(left: 10.0),
child: Text(locale.translate('cards.survey.title').toUpperCase(),
- style: dataCardTitleStyle),
+ style: fs16fw400ls1),
),
SizedBox(
height: 160,
@@ -57,7 +57,7 @@ class _SurveyCardState extends State {
);
Widget text = Text(
'${entry.value} ${locale.translate(entry.key).truncateTo(12)}',
- style: legendStyle,
+ style: fs12fw400,
);
return Row(
children: [
@@ -83,9 +83,10 @@ class _SurveyCardState extends State {
),
Text(
'$totalSurveys',
- style: surveysCardTotalTextStyle.copyWith(
- color:
- Theme.of(context).extension()!.grey800,
+ style: fs24fw700.copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .grey800,
),
)
],
diff --git a/lib/ui/carp_study_style.dart b/lib/ui/carp_study_style.dart
index 3d6f935f..0ac9bfce 100644
--- a/lib/ui/carp_study_style.dart
+++ b/lib/ui/carp_study_style.dart
@@ -1,8 +1,8 @@
part of carp_study_app;
@immutable
-class CarpColors extends ThemeExtension {
- const CarpColors({
+class StudyAppColors extends ThemeExtension {
+ const StudyAppColors({
this.primary,
this.warningColor,
this.backgroundGray,
@@ -44,7 +44,7 @@ class CarpColors extends ThemeExtension {
final Color? grey950;
@override
- CarpColors copyWith(
+ StudyAppColors copyWith(
{Color? primary,
Color? warningColor,
Color? backgroundGray,
@@ -61,7 +61,7 @@ class CarpColors extends ThemeExtension {
Color? grey800,
Color? grey900,
Color? grey950}) {
- return CarpColors(
+ return StudyAppColors(
primary: primary ?? this.primary,
warningColor: warningColor ?? this.warningColor,
backgroundGray: backgroundGray ?? this.backgroundGray,
@@ -82,11 +82,11 @@ class CarpColors extends ThemeExtension {
}
@override
- CarpColors lerp(CarpColors? other, double t) {
- if (other is! CarpColors) {
+ StudyAppColors lerp(StudyAppColors? other, double t) {
+ if (other is! StudyAppColors) {
return this;
}
- return CarpColors(
+ return StudyAppColors(
primary: Color.lerp(primary, other.primary, t),
warningColor: Color.lerp(warningColor, other.warningColor, t),
backgroundGray: Color.lerp(backgroundGray, other.backgroundGray, t),
@@ -109,7 +109,7 @@ class CarpColors extends ThemeExtension {
ThemeData carpStudyTheme = ThemeData.light().copyWith(
extensions: >[
- CarpColors(
+ StudyAppColors(
primary: const Color(0xff000000),
warningColor: Colors.orange[500],
backgroundGray: const Color(0xfff2f2f7),
@@ -179,7 +179,7 @@ ThemeData carpStudyTheme = ThemeData.light().copyWith(
ThemeData carpStudyDarkTheme = ThemeData.dark().copyWith(
extensions: >[
- CarpColors(
+ StudyAppColors(
primary: const Color(0xff24B2FF),
warningColor: Colors.orange[700],
backgroundGray: const Color(0xff0e0e0e),
@@ -253,13 +253,13 @@ ThemeData carpStudyDarkTheme = ThemeData.dark().copyWith(
// These TextStyles are now implemented in ResearchPackage
-// TextStyle studyTitleStyle =
+// TextStyle fs24fw600 =
// const TextStyle(fontSize: 24, fontWeight: FontWeight.w600);
-// TextStyle studyDetailsInfoTitle =
+// TextStyle fs16fw700 =
// const TextStyle(fontSize: 16, fontWeight: FontWeight.w700);
-// TextStyle studyDetailsInfoMessage =
+// TextStyle fs12fw700 =
// const TextStyle(fontSize: 12, fontWeight: FontWeight.w700);
// TextStyle readMoreStudyStyle =
@@ -278,29 +278,29 @@ ThemeData carpStudyDarkTheme = ThemeData.dark().copyWith(
// TextStyle scoreTextStyle =
// const TextStyle(fontSize: 12, fontWeight: FontWeight.w700);
-// TextStyle aboutStudyCardTitleStyle =
+// TextStyle fs24fw700 =
// const TextStyle(fontSize: 24, fontWeight: FontWeight.w700)
// .apply(fontFamily: 'OpenSans');
-// TextStyle aboutCardTitleStyle =
+// TextStyle fs20fw700 =
// const TextStyle(fontSize: 20, fontWeight: FontWeight.w700)
// .apply(fontFamily: 'OpenSans');
// TextStyle aboutCardInfoStyle =
// const TextStyle(fontSize: 14, fontStyle: FontStyle.italic);
-// TextStyle aboutCardSubtitleStyle =
+// TextStyle fs16fw600 =
// const TextStyle(fontSize: 16, fontWeight: FontWeight.w600);
-// TextStyle aboutCardContentStyle =
+// TextStyle fs16fw400 =
// const TextStyle(fontSize: 16, fontWeight: FontWeight.w400)
// .apply(fontFamily: 'OpenSans');
-// TextStyle aboutCardTimeAgoStyle =
+// TextStyle fs10fw600 =
// const TextStyle(fontSize: 10, fontWeight: FontWeight.w600)
// .apply(fontFamily: 'OpenSans');
-// TextStyle sectionTitleStyle =
+// TextStyle fs18fw700 =
// const TextStyle(fontSize: 18, fontWeight: FontWeight.w700);
// TextStyle inputFieldStyle =
@@ -312,18 +312,18 @@ ThemeData carpStudyDarkTheme = ThemeData.dark().copyWith(
// TextStyle studyDescriptionStyle =
// const TextStyle(fontSize: 12, fontWeight: FontWeight.w300);
-// TextStyle dataCardTitleStyle = const TextStyle(
+// TextStyle fs16fw400ls1 = const TextStyle(
// fontSize: 16, fontWeight: FontWeight.w400, letterSpacing: 1);
// TextStyle dataCardRightTitleStyle =
// const TextStyle(fontSize: 14, letterSpacing: 1);
// TextStyle measuresStyle =
// const TextStyle(fontSize: 18, fontWeight: FontWeight.w400);
-// TextStyle legendStyle =
+// TextStyle fs12fw400 =
// const TextStyle(fontSize: 12, fontWeight: FontWeight.w400);
-// TextStyle audioTitleStyle =
+// TextStyle fs22fw700 =
// const TextStyle(fontSize: 22, fontWeight: FontWeight.w700);
-// TextStyle audioContentStyle =
+// TextStyle fs16fw600 =
// const TextStyle(fontSize: 16, fontWeight: FontWeight.w700);
// TextStyle heartRateNumberStyle =
@@ -343,27 +343,27 @@ ThemeData carpStudyDarkTheme = ThemeData.dark().copyWith(
// TextStyle dataVizCardBottomText =
// const TextStyle(fontSize: 12, fontWeight: FontWeight.w700);
-// TextStyle deviceTitle =
+// TextStyle fs16fw700 =
// const TextStyle(fontSize: 16, fontWeight: FontWeight.w700);
-// TextStyle deviceSubtitle =
+// TextStyle fs12fw700 =
// const TextStyle(fontSize: 12, fontWeight: FontWeight.w700);
// TextStyle healthServiceConnectTitleStyle =
// const TextStyle(fontSize: 24, fontWeight: FontWeight.w700);
-// TextStyle healthServiceConnectMessageStyle =
+// TextStyle fs22fw700 =
// const TextStyle(fontSize: 22, fontWeight: FontWeight.w700);
-// TextStyle profileSectionStyle =
+// TextStyle fs12fw600 =
// TextStyle(fontSize: 12, fontWeight: FontWeight.w600);
-// TextStyle profileTitleStyle =
+// TextStyle fs14fw600 =
// TextStyle(fontSize: 14, fontWeight: FontWeight.w600);
-// TextStyle profileActionStyle =
+// TextStyle fs16fw600 =
// TextStyle(fontSize: 16, fontWeight: FontWeight.w600);
// TextStyle timerStyle =
// const TextStyle(fontSize: 36, fontWeight: FontWeight.w600);
-// TextStyle studyNameStyle =
+// TextStyle fs30fw800 =
// const TextStyle(fontSize: 30.0, fontWeight: FontWeight.w800);
diff --git a/lib/ui/pages/data_visualization_page.dart b/lib/ui/pages/data_visualization_page.dart
index 56db1a91..373b3ca6 100644
--- a/lib/ui/pages/data_visualization_page.dart
+++ b/lib/ui/pages/data_visualization_page.dart
@@ -16,7 +16,7 @@ class _DataVisualizationPageState extends State {
RPLocalizations locale = RPLocalizations.of(context)!;
return Scaffold(
backgroundColor:
- Theme.of(context).extension()!.backgroundGray,
+ Theme.of(context).extension()!.backgroundGray,
body: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@@ -38,9 +38,9 @@ class _DataVisualizationPageState extends State {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(locale.translate('pages.data_viz.title'),
- style: aboutStudyCardTitleStyle.copyWith(
+ style: fs24fw700.copyWith(
color: Theme.of(context)
- .extension()!
+ .extension()!
.grey900,
fontWeight: FontWeight.bold,
)),
@@ -60,9 +60,9 @@ class _DataVisualizationPageState extends State {
padding: const EdgeInsets.symmetric(
horizontal: 15, vertical: 24.0),
child: Text(locale.translate('pages.data_viz.thanks'),
- style: aboutCardSubtitleStyle.copyWith(
+ style: fs16fw600.copyWith(
color: Theme.of(context)
- .extension()!
+ .extension()!
.grey600,
)),
),
diff --git a/lib/ui/pages/device_list_page.dart b/lib/ui/pages/device_list_page.dart
index d392f148..9e563688 100644
--- a/lib/ui/pages/device_list_page.dart
+++ b/lib/ui/pages/device_list_page.dart
@@ -49,7 +49,8 @@ class DeviceListPageState extends State {
Widget build(BuildContext context) {
RPLocalizations locale = RPLocalizations.of(context)!;
return Scaffold(
- backgroundColor: Theme.of(context).extension()!.backgroundGray,
+ backgroundColor:
+ Theme.of(context).extension()!.backgroundGray,
body: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@@ -72,9 +73,10 @@ class DeviceListPageState extends State {
children: [
Text(
locale.translate('pages.devices.title'),
- style: aboutStudyCardTitleStyle.copyWith(
- color:
- Theme.of(context).extension()!.grey900,
+ style: fs24fw700.copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .grey900,
fontWeight: FontWeight.bold,
),
),
@@ -94,9 +96,9 @@ class DeviceListPageState extends State {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(locale.translate("pages.devices.message"),
- style: aboutCardSubtitleStyle.copyWith(
+ style: fs16fw600.copyWith(
color: Theme.of(context)
- .extension()!
+ .extension()!
.grey600,
)),
const SizedBox(height: 15),
@@ -134,7 +136,7 @@ class DeviceListPageState extends State {
builder: (BuildContext context, Widget? widget) => Center(
child: StudiesMaterial(
backgroundColor:
- Theme.of(context).extension()!.grey50!,
+ Theme.of(context).extension()!.grey50!,
child: _cardListBuilder(
leading: _smartphoneDevice[index].icon!,
title: (
@@ -182,8 +184,7 @@ class DeviceListPageState extends State {
child: Text(
locale.translate(
device.getDeviceStatusIcon as String),
- style: aboutCardTitleStyle.copyWith(
- color: Colors.white)),
+ style: fs20fw700.copyWith(color: Colors.white)),
),
),
);
@@ -218,8 +219,7 @@ class DeviceListPageState extends State {
child: Text(
locale.translate(
service.getServiceStatusIcon as String),
- style: aboutCardTitleStyle.copyWith(
- color: Colors.white),
+ style: fs20fw700.copyWith(color: Colors.white),
),
)
: service.getServiceStatusIcon as Icon,
@@ -255,8 +255,8 @@ class DeviceListPageState extends State {
children: [
Text(
title!.$1,
- style: deviceTitle.copyWith(
- color: Theme.of(context).extension()!.grey900,
+ style: fs16fw700.copyWith(
+ color: Theme.of(context).extension()!.grey900,
),
),
SizedBox(width: 6),
@@ -275,8 +275,9 @@ class DeviceListPageState extends State {
alignment: Alignment.centerLeft,
child: Text(
subtitle,
- style: deviceSubtitle.copyWith(
- color: Theme.of(context).extension()!.grey700,
+ style: fs12fw700.copyWith(
+ color:
+ Theme.of(context).extension()!.grey700,
),
),
),
@@ -300,7 +301,7 @@ class DeviceListPageState extends State {
) =>
Center(
child: StudiesMaterial(
- backgroundColor: Theme.of(context).extension()!.grey50!,
+ backgroundColor: Theme.of(context).extension()!.grey50!,
child: StreamBuilder(
stream: stream,
initialData: initialData,
@@ -320,7 +321,7 @@ class DeviceListPageState extends State {
Navigator.push(
context,
MaterialPageRoute(
- builder: (context) => HealthServiceConnectPage1()),
+ builder: (context) => HealthServiceConnectPage()),
);
} else {
await service.deviceManager.requestPermissions();
@@ -356,7 +357,7 @@ class DeviceListPageState extends State {
if (disconnect) await device.disconnectFromDevice();
} else {
final hasSeenInstructions =
- LocalSettings().hasSeenConnectionInstructions;
+ LocalSettings().hasSeenBluetoothConnectionInstructions;
Navigator.push(
context,
MaterialPageRoute(
diff --git a/lib/ui/pages/devices_page.authorization_dialog.dart b/lib/ui/pages/devices_page.authorization_dialog.dart
index ec22957e..f7a6f370 100644
--- a/lib/ui/pages/devices_page.authorization_dialog.dart
+++ b/lib/ui/pages/devices_page.authorization_dialog.dart
@@ -32,7 +32,7 @@ class AuthorizationDialog extends StatelessWidget {
Text(
locale.translate(
"pages.devices.connection.bluetooth_authorization.message"),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
),
Image(
diff --git a/lib/ui/pages/devices_page.bluetooth_connection_page.dart b/lib/ui/pages/devices_page.bluetooth_connection_page.dart
index 9d952dfc..0d0be9e1 100644
--- a/lib/ui/pages/devices_page.bluetooth_connection_page.dart
+++ b/lib/ui/pages/devices_page.bluetooth_connection_page.dart
@@ -41,16 +41,21 @@ class _BluetoothConnectionPageState extends State {
BluetoothDevice? selectedDevice;
int selected = 40;
+ /// Set of normalized UUIDs (no dashes, lower-case) to filter discovered devices by
+ /// If empty, no UUID filtering is applied.
+ final Set _filterUuids = {};
+
@override
Widget build(BuildContext context) {
RPLocalizations locale = RPLocalizations.of(context)!;
return Scaffold(
+ backgroundColor:
+ Theme.of(context).extension()!.backgroundGray,
body: SafeArea(
child: Stack(
children: [
Container(
- color: Theme.of(context).colorScheme.secondary,
child: Column(
children: [
Padding(
@@ -120,7 +125,7 @@ class _BluetoothConnectionPageState extends State {
Flexible(
child: Text(
stepTitleMap[currentStep] ?? '',
- style: healthServiceConnectMessageStyle.copyWith(
+ style: fs22fw700.copyWith(
color: Theme.of(context).primaryColor,
),
textAlign: TextAlign.center,
@@ -165,7 +170,7 @@ class _BluetoothConnectionPageState extends State {
_connectDevice(),
selectedDevice != null,
ElevatedButton.styleFrom(
- backgroundColor: Theme.of(context).extension()!.primary,
+ backgroundColor: Theme.of(context).extension()!.primary,
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 12),
),
TextStyle(
@@ -186,7 +191,7 @@ class _BluetoothConnectionPageState extends State {
},
true,
ElevatedButton.styleFrom(
- backgroundColor: Theme.of(context).extension()!.primary,
+ backgroundColor: Theme.of(context).extension()!.primary,
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 12),
),
TextStyle(
@@ -206,7 +211,7 @@ class _BluetoothConnectionPageState extends State {
},
true,
ElevatedButton.styleFrom(
- backgroundColor: Theme.of(context).extension()!.primary,
+ backgroundColor: Theme.of(context).extension()!.primary,
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 12),
),
TextStyle(
@@ -305,41 +310,55 @@ class _BluetoothConnectionPageState extends State {
"${locale.translate("pages.devices.connection.step.scan.1")} "
"${locale.translate(device.typeName)} "
"${locale.translate("pages.devices.connection.step.scan.2")}",
- style: healthServiceConnectMessageStyle,
+ style: fs22fw700,
textAlign: TextAlign.justify,
),
Expanded(
child: StreamBuilder>(
stream: FlutterBluePlus.scanResults,
initialData: const [],
- builder: (context, snapshot) => SingleChildScrollView(
- padding: const EdgeInsets.only(top: 16),
- child: Column(
- children: snapshot.data!
- .where(
- (element) => element.device.platformName.isNotEmpty)
- .toList()
- .asMap()
- .entries
- .map(
- (bluetoothDevice) => ListTile(
- selected: bluetoothDevice.key == selected,
- title: Text(
- bluetoothDevice.value.device.platformName,
- style: healthServiceConnectMessageStyle,
+ builder: (context, snapshot) => Scrollbar(
+ thumbVisibility: true,
+ child: SingleChildScrollView(
+ padding: const EdgeInsets.only(top: 16),
+ child: Column(
+ children: snapshot.data!
+ .where((element) =>
+ element.device.platformName.isNotEmpty &&
+ _matchesUuid(element, _filterUuids))
+ .toList()
+ .asMap()
+ .entries
+ .map(
+ (bluetoothDevice) => StudiesMaterial(
+ // hasBorder: true,
+ backgroundColor: Theme.of(context)
+ .extension()!
+ .grey50!,
+ child: InkWell(
+ child: ListTile(
+ selected: bluetoothDevice.key == selected,
+ title: Text(
+ bluetoothDevice.value.device.platformName,
+ style: fs22fw700.copyWith(
+ fontSize: 20,
+ ),
+ ),
+ selectedTileColor: Theme.of(context)
+ .primaryColor
+ .withValues(alpha: 0.2),
+ ),
+ onTap: () {
+ selectedDevice = bluetoothDevice.value.device;
+ setState(() {
+ selected = bluetoothDevice.key;
+ });
+ },
+ ),
),
- selectedTileColor: Theme.of(context)
- .primaryColor
- .withValues(alpha: 0.2),
- onTap: () {
- selectedDevice = bluetoothDevice.value.device;
- setState(() {
- selected = bluetoothDevice.key;
- });
- },
- ),
- )
- .toList(),
+ )
+ .toList(),
+ ),
),
),
),
@@ -357,7 +376,7 @@ class _BluetoothConnectionPageState extends State {
text: locale
.translate("pages.devices.connection.instructions"),
style: TextStyle(
- color: Theme.of(context).extension()!.primary,
+ color: Theme.of(context).extension()!.primary,
decoration: TextDecoration.underline,
fontWeight: FontWeight.bold,
),
@@ -373,8 +392,8 @@ class _BluetoothConnectionPageState extends State {
),
],
),
- style: healthServiceConnectMessageStyle.copyWith(
- color: Theme.of(context).extension()!.grey900),
+ style: fs22fw700.copyWith(
+ color: Theme.of(context).extension()!.grey900),
textAlign: TextAlign.center,
),
)
@@ -383,6 +402,34 @@ class _BluetoothConnectionPageState extends State {
);
}
+ /// Returns true if [scanResult] advertises any UUID present in [filterUuids].
+ /// If [filterUuids] is empty, always returns true.
+ bool _matchesUuid(ScanResult scanResult, Set filterUuids) {
+ if (filterUuids.isEmpty) return true;
+
+ // Normalize helper: remove dashes and lowercase
+ String normalize(String u) => u.replaceAll('-', '').toLowerCase();
+
+ try {
+ // FlutterBluePlus ScanResult contains advertisementData with serviceUuids
+ final adv = scanResult.advertisementData;
+ final serviceUuids = adv.serviceUuids;
+ for (var u in serviceUuids) {
+ final us = u.toString();
+ if (filterUuids.contains(normalize(us))) return true;
+ }
+
+ // Also check device id (remoteId) as fallback
+ final devId = scanResult.device.remoteId.str;
+ if (filterUuids.contains(normalize(devId))) return true;
+ } catch (_) {
+ // If structure differs, fall back to allowing the device
+ return true;
+ }
+
+ return false;
+ }
+
Widget connectionInstructions(DeviceViewModel device, BuildContext context) {
RPLocalizations locale = RPLocalizations.of(context)!;
AssetImage? assetImage;
@@ -420,8 +467,8 @@ class _BluetoothConnectionPageState extends State {
Image connectionImage = Image(
image: assetImage,
- width: MediaQuery.of(context).size.height * 0.5,
- height: MediaQuery.of(context).size.height * 0.5,
+ width: MediaQuery.of(context).size.height * 0.3,
+ height: MediaQuery.of(context).size.height * 0.3,
);
return Column(
children: [
@@ -436,7 +483,7 @@ class _BluetoothConnectionPageState extends State {
padding: const EdgeInsets.only(bottom: 20.0),
child: Text(
locale.translate(device.connectionInstructions!),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
),
),
@@ -467,7 +514,7 @@ class _BluetoothConnectionPageState extends State {
child: Text(
("${locale.translate("pages.devices.connection.step.confirm.1")} '${device?.platformName}' ${locale.translate("pages.devices.connection.step.confirm.2")}")
.trim(),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
),
),
diff --git a/lib/ui/pages/devices_page.disconnection_dialog.dart b/lib/ui/pages/devices_page.disconnection_dialog.dart
index a1326908..0390df0e 100644
--- a/lib/ui/pages/devices_page.disconnection_dialog.dart
+++ b/lib/ui/pages/devices_page.disconnection_dialog.dart
@@ -26,7 +26,7 @@ class DisconnectionDialog extends StatelessWidget {
children: [
Text(
"${locale.translate("pages.devices.connection.disconnect_bluetooth.message")} ${locale.translate(device.name)}?",
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
),
Row(
diff --git a/lib/ui/pages/devices_page.enable_bluetooth_dialog.dart b/lib/ui/pages/devices_page.enable_bluetooth_dialog.dart
index 7c6d3aa6..72944dfc 100644
--- a/lib/ui/pages/devices_page.enable_bluetooth_dialog.dart
+++ b/lib/ui/pages/devices_page.enable_bluetooth_dialog.dart
@@ -31,7 +31,7 @@ class EnableBluetoothDialog extends StatelessWidget {
Text(
locale.translate(
"pages.devices.connection.enable_bluetooth.message1"),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
),
Padding(
@@ -40,7 +40,7 @@ class EnableBluetoothDialog extends StatelessWidget {
Text(
locale.translate(
"pages.devices.connection.enable_bluetooth.message2"),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
),
if (Platform.isAndroid || Platform.isIOS)
@@ -54,7 +54,7 @@ class EnableBluetoothDialog extends StatelessWidget {
Text(
locale.translate(
"pages.devices.connection.enable_bluetooth.message3"),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
),
],
diff --git a/lib/ui/pages/devices_page.health_service_connect2.dart b/lib/ui/pages/devices_page.health_service_connect.dart
similarity index 52%
rename from lib/ui/pages/devices_page.health_service_connect2.dart
rename to lib/ui/pages/devices_page.health_service_connect.dart
index 9d79643d..0a35387b 100644
--- a/lib/ui/pages/devices_page.health_service_connect2.dart
+++ b/lib/ui/pages/devices_page.health_service_connect.dart
@@ -1,7 +1,7 @@
part of carp_study_app;
-class HealthServiceConnectPage2 extends StatelessWidget {
- const HealthServiceConnectPage2({super.key});
+class HealthServiceConnectPage extends StatelessWidget {
+ const HealthServiceConnectPage({super.key});
@override
Widget build(BuildContext context) {
@@ -14,15 +14,15 @@ class HealthServiceConnectPage2 extends StatelessWidget {
.first;
return Scaffold(
+ backgroundColor: Theme.of(context).extension()!.grey100,
body: SafeArea(
child: Container(
- color: Theme.of(context).colorScheme.secondary,
child: Column(
children: [
Padding(
padding:
const EdgeInsets.symmetric(vertical: 8.0, horizontal: 18),
- child: const CarpAppBar(hasProfileIcon: true),
+ child: const CarpAppBar(),
),
Expanded(
child: Padding(
@@ -30,25 +30,15 @@ class HealthServiceConnectPage2 extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
- Container(
- padding: const EdgeInsets.all(20),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(20),
- boxShadow: [
- BoxShadow(
- color: Colors.black.withValues(alpha: 0.1),
- blurRadius: 10,
- spreadRadius: 2,
- ),
- ],
- ),
- child: Image.asset(
- Platform.isAndroid
- ? 'assets/instructions/google_health_connect_icon.png'
- : 'assets/instructions/apple_health_icon.png',
- height: 250,
- width: 250,
+ Expanded(
+ child: Center(
+ child: Image.asset(
+ Platform.isAndroid
+ ? 'assets/instructions/google_health_connect_preview.png'
+ : 'assets/instructions/apple_health_preview.png',
+ fit: BoxFit.contain,
+ width: double.infinity,
+ ),
),
),
const SizedBox(height: 20),
@@ -58,36 +48,36 @@ class HealthServiceConnectPage2 extends StatelessWidget {
TextSpan(
text:
"${locale.translate("pages.devices.type.health.instructions.page2.part1")} ",
- style: healthServiceConnectMessageStyle.copyWith(
+ style: fs22fw700.copyWith(
color: Theme.of(context)
- .extension()!
+ .extension()!
.grey900,
),
),
TextSpan(
text:
"${Platform.isAndroid ? locale.translate("pages.devices.type.health.instructions.page2.android.allow_all") : locale.translate("pages.devices.type.health.instructions.page2.ios.turn_on_all")} ",
- style: healthServiceConnectMessageStyle.copyWith(
+ style: fs22fw700.copyWith(
color: Theme.of(context)
- .extension()!
+ .extension()!
.primary, // Change to desired color
),
),
TextSpan(
text:
"${locale.translate("pages.devices.type.health.instructions.page2.part2")} ",
- style: healthServiceConnectMessageStyle.copyWith(
+ style: fs22fw700.copyWith(
color: Theme.of(context)
- .extension()!
+ .extension()!
.grey900,
),
),
TextSpan(
text:
"${locale.translate("pages.devices.type.health.instructions.page2.allow")} ",
- style: healthServiceConnectMessageStyle.copyWith(
+ style: fs22fw700.copyWith(
color: Theme.of(context)
- .extension()!
+ .extension()!
.primary, // Change to desired color
),
),
@@ -97,9 +87,9 @@ class HealthServiceConnectPage2 extends StatelessWidget {
"pages.devices.type.health.instructions.page2.part3.android")
: locale.translate(
"pages.devices.type.health.instructions.page2.part3.ios"),
- style: healthServiceConnectMessageStyle.copyWith(
+ style: fs22fw700.copyWith(
color: Theme.of(context)
- .extension()!
+ .extension()!
.grey900,
),
),
@@ -108,39 +98,6 @@ class HealthServiceConnectPage2 extends StatelessWidget {
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: [
- OutlinedButton(
- child: const Text("Cancel"),
- onPressed: () {
- Navigator.pop(context);
- },
- ),
- ElevatedButton(
- child: const Text(
- "Next",
- style: TextStyle(
- color: Colors.white,
- ),
- ),
- style: ElevatedButton.styleFrom(
- backgroundColor: Theme.of(context)
- .extension()!
- .primary,
- padding: const EdgeInsets.symmetric(
- horizontal: 30, vertical: 12),
- ),
- onPressed: () async {
- await healthServive.deviceManager
- .requestPermissions();
- await healthServive.deviceManager.connect();
-
- Navigator.pop(context);
- },
- ),
- ],
- ),
],
),
),
@@ -149,6 +106,40 @@ class HealthServiceConnectPage2 extends StatelessWidget {
),
),
),
+ bottomNavigationBar: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 26),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: [
+ OutlinedButton(
+ child: const Text("Cancel"),
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ ElevatedButton(
+ child: const Text(
+ "Next",
+ style: TextStyle(
+ color: Colors.white,
+ ),
+ ),
+ style: ElevatedButton.styleFrom(
+ backgroundColor:
+ Theme.of(context).extension()!.primary,
+ padding:
+ const EdgeInsets.symmetric(horizontal: 30, vertical: 12),
+ ),
+ onPressed: () async {
+ await healthServive.deviceManager.requestPermissions();
+ await healthServive.deviceManager.connect();
+
+ Navigator.pop(context);
+ },
+ ),
+ ],
+ ),
+ ),
);
}
}
diff --git a/lib/ui/pages/devices_page.health_service_connect1.dart b/lib/ui/pages/devices_page.health_service_connect1.dart
deleted file mode 100644
index 70f358e8..00000000
--- a/lib/ui/pages/devices_page.health_service_connect1.dart
+++ /dev/null
@@ -1,116 +0,0 @@
-part of carp_study_app;
-
-class HealthServiceConnectPage1 extends StatelessWidget {
- const HealthServiceConnectPage1({super.key});
-
- @override
- Widget build(BuildContext context) {
- RPLocalizations locale = RPLocalizations.of(context)!;
- return Scaffold(
- body: SafeArea(
- child: Container(
- color: Theme.of(context).colorScheme.secondary,
- child: Column(
- children: [
- Padding(
- padding:
- const EdgeInsets.symmetric(vertical: 8.0, horizontal: 18),
- child: const CarpAppBar(hasProfileIcon: true),
- ),
- Expanded(
- child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 24.0),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Container(
- padding: const EdgeInsets.all(20),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(20),
- boxShadow: [
- BoxShadow(
- color: Colors.black.withValues(alpha: 0.1),
- blurRadius: 10,
- spreadRadius: 2,
- ),
- ],
- ),
- child: Image.asset(
- Platform.isAndroid
- ? 'assets/instructions/google_health_connect_icon.png'
- : 'assets/instructions/apple_health_icon.png',
- height: 250,
- width: 250,
- ),
- ),
- const SizedBox(height: 20),
- Text(
- Platform.isAndroid
- ? locale.translate(
- "pages.devices.type.health.instructions.page1.android")
- : locale.translate(
- "pages.devices.type.health.instructions.page1.ios"),
- style: healthServiceConnectTitleStyle.copyWith(
- color: Theme.of(context)
- .extension()!
- .primary),
- textAlign: TextAlign.center,
- ),
- const SizedBox(height: 10),
- Text(
- "${locale.translate("pages.devices.type.health.instructions.page1.part1")} "
- "${Platform.isAndroid ? locale.translate("pages.devices.type.health.instructions.page1.android") : locale.translate("pages.devices.type.health.instructions.page1.ios")} "
- "${locale.translate("pages.devices.type.health.instructions.page1.part2")}",
- style: healthServiceConnectMessageStyle.copyWith(
- color: Theme.of(context)
- .extension()!
- .grey900),
- textAlign: TextAlign.center,
- ),
- const SizedBox(height: 30),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: [
- OutlinedButton(
- child: const Text("Cancel"),
- onPressed: () {
- Navigator.pop(context);
- },
- ),
- ElevatedButton(
- child: Text(
- locale.translate("Next"),
- style: TextStyle(
- color: Colors.white,
- ),
- ),
- style: ElevatedButton.styleFrom(
- backgroundColor: Theme.of(context)
- .extension()!
- .primary,
- padding: const EdgeInsets.symmetric(
- horizontal: 30, vertical: 12),
- ),
- onPressed: () {
- Navigator.pushReplacement(
- context,
- MaterialPageRoute(
- builder: (context) =>
- HealthServiceConnectPage2()),
- );
- },
- ),
- ],
- ),
- ],
- ),
- ),
- ),
- ],
- ),
- ),
- ),
- );
- }
-}
diff --git a/lib/ui/pages/devices_page.list_title.dart b/lib/ui/pages/devices_page.list_title.dart
index 339c4c7f..19f57309 100644
--- a/lib/ui/pages/devices_page.list_title.dart
+++ b/lib/ui/pages/devices_page.list_title.dart
@@ -23,8 +23,8 @@ class DevicesPageListTitle extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 6),
child: Text(
locale.translate("pages.devices.${type.name}.title").toUpperCase(),
- style: dataCardTitleStyle.copyWith(
- color: Theme.of(context).extension()!.grey900,
+ style: fs16fw400ls1.copyWith(
+ color: Theme.of(context).extension()!.grey900,
fontWeight: FontWeight.bold)),
),
);
diff --git a/lib/ui/pages/enable_connection_dialog.dart b/lib/ui/pages/enable_connection_dialog.dart
index 5ebb653d..cf5c7776 100644
--- a/lib/ui/pages/enable_connection_dialog.dart
+++ b/lib/ui/pages/enable_connection_dialog.dart
@@ -37,7 +37,7 @@ class EnableInternetConnectionDialog extends StatelessWidget {
Text(
locale.translate(
"pages.login.internet_connection.enable_internet_connections.general_message"),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
),
Padding(
@@ -45,7 +45,7 @@ class EnableInternetConnectionDialog extends StatelessWidget {
child: Text(
locale.translate(
"pages.login.internet_connection.enable_internet_connections.wifi_message"),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
)),
Padding(
@@ -60,7 +60,7 @@ class EnableInternetConnectionDialog extends StatelessWidget {
child: Text(
locale.translate(
"pages.login.internet_connection.enable_internet_connections.mobile_data_message"),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
),
),
@@ -111,7 +111,7 @@ class EnableInternetConnectionDialog extends StatelessWidget {
Text(
locale.translate(
"pages.login.internet_connection.enable_internet_connections.general_message"),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
),
Padding(
@@ -119,7 +119,7 @@ class EnableInternetConnectionDialog extends StatelessWidget {
child: Text(
locale.translate(
"pages.login.internet_connection.enable_internet_connections.wifi_message"),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
)),
Padding(
@@ -135,7 +135,7 @@ class EnableInternetConnectionDialog extends StatelessWidget {
Text(
locale.translate(
"pages.login.internet_connection.enable_internet_connections.mobile_data_message"),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
),
]),
diff --git a/lib/ui/pages/home_page.dart b/lib/ui/pages/home_page.dart
index aa6aacc8..791a9920 100644
--- a/lib/ui/pages/home_page.dart
+++ b/lib/ui/pages/home_page.dart
@@ -96,19 +96,22 @@ class HomePageState extends State {
AppTaskController().userTaskEvents.listen((userTask) {
if (userTask.state == UserTaskState.notified) {
userTask.onStart();
- if (userTask.hasWidget) context.push('/task/${userTask.id}');
+ if (userTask.hasWidget) {
+ _rootNavigatorKey.currentContext?.push('/task/${userTask.id}');
+ }
}
});
return Scaffold(
- backgroundColor: Theme.of(context).extension()!.backgroundGray,
+ backgroundColor:
+ Theme.of(context).extension()!.backgroundGray,
body: SafeArea(
child: widget.child,
),
bottomNavigationBar: BottomNavigationBar(
- backgroundColor: Theme.of(context).extension()!.white,
+ backgroundColor: Theme.of(context).extension()!.white,
type: BottomNavigationBarType.fixed,
- selectedItemColor: Theme.of(context).extension()!.primary,
+ selectedItemColor: Theme.of(context).extension()!.primary,
//unselectedItemColor: Theme.of(context).primaryColor.withOpacity(0.8),
items: [
BottomNavigationBarItem(
diff --git a/lib/ui/pages/home_page.install_health_connect_dialog.dart b/lib/ui/pages/home_page.install_health_connect_dialog.dart
index 2a60a0cf..2129ece0 100644
--- a/lib/ui/pages/home_page.install_health_connect_dialog.dart
+++ b/lib/ui/pages/home_page.install_health_connect_dialog.dart
@@ -14,7 +14,7 @@ class InstallHealthConnectDialog extends StatelessWidget {
),
content: Text(
locale.translate('pages.about.install_health_connect.description'),
- style: aboutCardContentStyle,
+ style: fs16fw400,
textAlign: TextAlign.justify,
),
actions: [
diff --git a/lib/ui/pages/invitation_list_page.dart b/lib/ui/pages/invitation_list_page.dart
index 0180d634..d6ddbadb 100644
--- a/lib/ui/pages/invitation_list_page.dart
+++ b/lib/ui/pages/invitation_list_page.dart
@@ -9,7 +9,8 @@ class InvitationListPage extends StatelessWidget {
Widget build(BuildContext context) {
RPLocalizations locale = RPLocalizations.of(context)!;
return Scaffold(
- backgroundColor: Theme.of(context).extension()!.backgroundGray,
+ backgroundColor:
+ Theme.of(context).extension()!.backgroundGray,
body: FutureBuilder>(
future: bloc.backend.getInvitations(),
builder: (context, snapshot) {
@@ -38,7 +39,7 @@ class InvitationListPage extends StatelessWidget {
slivers: [
SliverAppBar(
backgroundColor:
- Theme.of(context).extension()!.backgroundGray,
+ Theme.of(context).extension