Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
feat: notifications page blueberry ring switches
Browse files Browse the repository at this point in the history
  • Loading branch information
reasje committed Jul 10, 2024
1 parent fad7b57 commit b43122d
Showing 1 changed file with 41 additions and 165 deletions.
206 changes: 41 additions & 165 deletions lib/features/settings/subfeatures/notifications/notificaitons_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -297,30 +297,7 @@ class NotificationsPage extends HookConsumerWidget {
onChanged: notificationsPresenter.changeActivityReminderEnabled,
enabled: isSettingsChangeEnabled,
textTrailingWidget: MXCInformationButton(
texts: [
TextSpan(
text:
FlutterI18n.translate(context, 'experiencing_issues'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(context,
'blueberry_background_notifications_requirements_title'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
TextSpan(
text: FlutterI18n.translate(context,
'blueberry_background_notifications_requirements_text'),
style: FontTheme.of(context)
.subtitle1()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
],
texts: getBlueberryRingServiceInfo(context),
),
titleStyle: FontTheme.of(context).h6(),
),
Expand All @@ -332,53 +309,7 @@ class NotificationsPage extends HookConsumerWidget {
onChanged: notificationsPresenter.changeSleepInsightEnabled,
enabled: isSettingsChangeEnabled,
textTrailingWidget: MXCInformationButton(
texts: [
TextSpan(
text:
FlutterI18n.translate(context, 'experiencing_issues'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(
context, 'background_service_solution_1_title'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
TextSpan(
text: FlutterI18n.translate(
context, 'background_service_solution_1_text'),
style: FontTheme.of(context)
.subtitle1()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(
context, 'background_service_solution_2_title'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
TextSpan(
text: FlutterI18n.translate(
context, 'background_service_solution_2_text'),
style: FontTheme.of(context)
.subtitle1()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(
context, 'need_further_assistant'),
style: FontTheme.of(context)
.subtitle1()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
],
texts: getBlueberryRingServiceInfo(context),
),
titleStyle: FontTheme.of(context).h6(),
),
Expand All @@ -389,53 +320,7 @@ class NotificationsPage extends HookConsumerWidget {
onChanged: notificationsPresenter.changeHeartAlertEnabled,
enabled: isSettingsChangeEnabled,
textTrailingWidget: MXCInformationButton(
texts: [
TextSpan(
text:
FlutterI18n.translate(context, 'experiencing_issues'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(
context, 'background_service_solution_1_title'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
TextSpan(
text: FlutterI18n.translate(
context, 'background_service_solution_1_text'),
style: FontTheme.of(context)
.subtitle1()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(
context, 'background_service_solution_2_title'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
TextSpan(
text: FlutterI18n.translate(
context, 'background_service_solution_2_text'),
style: FontTheme.of(context)
.subtitle1()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(
context, 'need_further_assistant'),
style: FontTheme.of(context)
.subtitle1()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
],
texts: getBlueberryRingServiceInfo(context),
),
titleStyle: FontTheme.of(context).h6(),
),
Expand All @@ -446,53 +331,7 @@ class NotificationsPage extends HookConsumerWidget {
onChanged: notificationsPresenter.changeLowBatteryEnabled,
enabled: isSettingsChangeEnabled,
textTrailingWidget: MXCInformationButton(
texts: [
TextSpan(
text:
FlutterI18n.translate(context, 'experiencing_issues'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(
context, 'background_service_solution_1_title'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
TextSpan(
text: FlutterI18n.translate(
context, 'background_service_solution_1_text'),
style: FontTheme.of(context)
.subtitle1()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(
context, 'background_service_solution_2_title'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
TextSpan(
text: FlutterI18n.translate(
context, 'background_service_solution_2_text'),
style: FontTheme.of(context)
.subtitle1()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(
context, 'need_further_assistant'),
style: FontTheme.of(context)
.subtitle1()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
],
texts: getBlueberryRingServiceInfo(context),
),
titleStyle: FontTheme.of(context).h6(),
),
Expand Down Expand Up @@ -522,3 +361,40 @@ class NotificationsPage extends HookConsumerWidget {
);
}
}

List<TextSpan> getBlueberryRingServiceInfo(
BuildContext context,
) {
return [
TextSpan(
text: FlutterI18n.translate(context, 'experiencing_issues'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(
context, 'blueberry_background_notifications_requirements_title'),
style: FontTheme.of(context)
.subtitle2()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(
context, 'blueberry_background_notifications_requirements_text_1'),
style: FontTheme.of(context)
.subtitle1()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
const TextSpan(text: '\n\n'),
TextSpan(
text: FlutterI18n.translate(
context, 'blueberry_background_notifications_requirements_text_2'),
style: FontTheme.of(context)
.subtitle1()
.copyWith(color: ColorsTheme.of(context).textPrimary),
),
];
}

0 comments on commit b43122d

Please sign in to comment.