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..40280f63 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 4.2.0
+
+* moving to carp_themes_package instead of research package themes
+
## 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/build.gradle b/android/build.gradle
index a9e61289..1c67b3aa 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -12,8 +12,6 @@ allprojects {
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
-}
-subprojects {
project.evaluationDependsOn(':app')
}
diff --git a/assets/instructions/apple_health_preview.png b/assets/instructions/apple_health_preview.png
new file mode 100644
index 00000000..89113a45
Binary files /dev/null and b/assets/instructions/apple_health_preview.png differ
diff --git a/assets/instructions/google_health_connect_preview.png b/assets/instructions/google_health_connect_preview.png
new file mode 100644
index 00000000..b0cb0528
Binary files /dev/null and b/assets/instructions/google_health_connect_preview.png differ
diff --git a/assets/lang/da.json b/assets/lang/da.json
index e08855bb..1d44c86c 100644
--- a/assets/lang/da.json
+++ b/assets/lang/da.json
@@ -97,9 +97,9 @@
"pages.profile.device_role": "Engedsrolle",
"pages.profile.contact": "Kontakt forsker",
"pages.profile.privacy": "Fortrolighedspolitik",
- "pages.profile.study_website": "Studiw Hjemmeside",
+ "pages.profile.study_website": "Hjemmeside for studiet",
"pages.profile.leave_study": "Forlad studie",
- "pages.profile.log_out": "Log ud",
+ "pages.profile.log_out": "Forlad studie & Log ud",
"pages.profile.log_out.confirmation": "Du er ved at forlade dette studie og logge af. Operativsystemet vil åbne en browser for at logge dig ud. Er du sikker?",
"pages.profile.leave_study.confirmation": "Du er ved at forlade studiet. Du vil ikke længere deltage i dette studie. Er du sikker?",
"announcements": "Annonceringer",
diff --git a/assets/lang/en.json b/assets/lang/en.json
index aae2fb09..1dce60f2 100644
--- a/assets/lang/en.json
+++ b/assets/lang/en.json
@@ -110,9 +110,9 @@
"pages.profile.device_id": "Device ID",
"pages.profile.contact": "Contact researcher",
"pages.profile.privacy": "Privacy policy",
- "pages.profile.study_website": "Study Website",
+ "pages.profile.study_website": "Study website",
"pages.profile.leave_study": "Leave study",
- "pages.profile.log_out": "Log out",
+ "pages.profile.log_out": "Leave study & Log out",
"pages.profile.log_out.confirmation": "You are about to leave this study and log out. The operating system will open a browser to log you out. Are you sure?",
"pages.profile.leave_study.confirmation": "You are about to leave the study. You will no longer participate in this study. Are you sure?",
"announcements": "Announcements",
@@ -244,4 +244,4 @@
"tasks.participant_data.phone_number.country": "Country code",
"tasks.participant_data.phone_number.phone_number": "Phone No.",
"tasks.participant_data.review.title": "Review"
-}
+}
\ No newline at end of file
diff --git a/assets/lang/es.json b/assets/lang/es.json
index b4f811b1..b9bf74db 100644
--- a/assets/lang/es.json
+++ b/assets/lang/es.json
@@ -58,8 +58,9 @@
"pages.profile.account_id": "Id Usuario",
"pages.profile.contact": "Contactar investigador",
"pages.profile.privacy": "Política de privacidad",
+ "pages.profile.study_website": "Página web del estudio",
"pages.profile.leave_study": "Abandonar el estudio",
- "pages.profile.log_out": "Cerrar sesión",
+ "pages.profile.log_out": "Cerrar estudio & sesión",
"pages.profile.log_out.confirmation": "Estás a punto de cerrar sesión et abandonar el estudio. ¿Estás seguro?",
"pages.profile.leave_study.confirmation": "Estás a punto de abandonar el estudio. Dejarás de participar en el es estudio. ¿Estás seguro?",
"announcement": "Anuncio",
@@ -121,4 +122,4 @@
"pages.devices.connection.step.confirm.title": "está conectado!",
"pages.devices.connection.step.confirm.1": "El",
"pages.devices.connection.step.confirm.2": " ha sido connectado satisfactoriamente al estudio y está listo para empezar a detectar."
-}
+}
\ No newline at end of file
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 0384b5ed..faec3eff 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -97,7 +97,7 @@ PODS:
- sqflite_darwin (0.0.4):
- Flutter
- FlutterMacOS
- - SwiftProtobuf (1.31.1)
+ - SwiftProtobuf (1.32.0)
- url_launcher_ios (0.0.1):
- Flutter
- video_player_avfoundation (0.0.1):
@@ -267,7 +267,7 @@ SPEC CHECKSUMS:
oidc_ios: 16966cad509ce6850ca4ca1216c5138bef2a8726
open_settings_plus: d19f91e8a04649358a51c19b484ce2e637149d70
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
- path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
+ path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
pedometer: 1c5eaab0c6bce8eb7651f7095553b5081c9d06ed
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
PhoneNumberKit: ec00ab8cef5342c1dc49fadb99d23fa7e66cf0ef
@@ -277,11 +277,11 @@ SPEC CHECKSUMS:
RxSwift: 4e28be97cbcfeee614af26d83415febbf2bf6f45
screen_state: 52d6e997d31bddba6417c60d9cdd22effd0320a7
sensors_plus: 6a11ed0c2e1d0bd0b20b4029d3bad27d96e0c65b
- shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
+ shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
- SwiftProtobuf: e02f51c8c2df5845657aee2d4de9d61bf50ef788
- url_launcher_ios: 694010445543906933d732453a59da0a173ae33d
- video_player_avfoundation: 2cef49524dd1f16c5300b9cd6efd9611ce03639b
+ SwiftProtobuf: 81e341191afbddd64aa031bd12862dccfab2f639
+ url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
+ video_player_avfoundation: dd410b52df6d2466a42d28550e33e4146928280a
Zip: b3fef584b147b6e582b2256a9815c897d60ddc67
PODFILE CHECKSUM: 0f233b2493d660073cf18073d2b24e7b319ab4a8
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 301e663d..9570d6a3 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -115,7 +115,5 @@
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()!.backgroundGray,
title: const CarpAppBar(),
centerTitle: true,
pinned: true,
@@ -121,7 +122,7 @@ class InvitationMaterial extends StatelessWidget {
Widget build(BuildContext context) {
RPLocalizations locale = RPLocalizations.of(context)!;
return StudiesMaterial(
- backgroundColor: Theme.of(context).extension()!.white!,
+ backgroundColor: Theme.of(context).extension()!.white!,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0),
),
@@ -138,7 +139,7 @@ class InvitationMaterial extends StatelessWidget {
Text(
invitation.invitation.name,
maxLines: 1,
- style: studyTitleStyle.copyWith(
+ style: fs24fw600.copyWith(
color: CACHET.TASK_COMPLETED_BLUE,
overflow: TextOverflow.ellipsis),
),
@@ -148,15 +149,17 @@ class InvitationMaterial extends StatelessWidget {
TextSpan(
text: locale.translate(
'invitation_list.roles_in_the_study.description'),
- style: studyDetailsInfoTitle.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs16fw700.copyWith(
+ color:
+ Theme.of(context).extension()!.grey600,
fontSize: 12,
),
),
TextSpan(
text: invitation.participantRoleName,
- style: studyDetailsInfoTitle.copyWith(
- color: Theme.of(context).extension()!.grey600,
+ style: fs16fw700.copyWith(
+ color:
+ Theme.of(context).extension()!.grey600,
fontSize: 12,
),
),
@@ -166,8 +169,8 @@ class InvitationMaterial extends StatelessWidget {
Text(
invitation.invitation.description ?? '',
maxLines: 2,
- style: studyDetailsInfoTitle.copyWith(
- color: Theme.of(context).extension()!.grey900,
+ style: fs16fw700.copyWith(
+ color: Theme.of(context).extension()!.grey900,
overflow: TextOverflow.ellipsis,
),
),
diff --git a/lib/ui/pages/invitation_page.dart b/lib/ui/pages/invitation_page.dart
index 76199656..c7084b18 100644
--- a/lib/ui/pages/invitation_page.dart
+++ b/lib/ui/pages/invitation_page.dart
@@ -17,7 +17,8 @@ class InvitationDetailsPage extends StatelessWidget {
var invitation = model.getInvitation(invitationId);
return Scaffold(
- backgroundColor: Theme.of(context).extension()!.backgroundGray,
+ backgroundColor:
+ Theme.of(context).extension()!.backgroundGray,
body: Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: SafeArea(
@@ -59,7 +60,7 @@ class InvitationDetailsPage extends StatelessWidget {
padding: const EdgeInsets.only(top: 16.0),
child: StudiesMaterial(
backgroundColor:
- Theme.of(context).extension