mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 00:51:20 +00:00
refactor: Change getOverrideColor lambda to simple variable in backup page
This commit is contained in:
parent
a67c203266
commit
cd452d5f26
|
@ -83,7 +83,7 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Color? getOverrideColor() =>
|
final Color? overrideColor =
|
||||||
preventActions ? Theme.of(context).colorScheme.secondary : null;
|
preventActions ? Theme.of(context).colorScheme.secondary : null;
|
||||||
|
|
||||||
return BrandHeroScreen(
|
return BrandHeroScreen(
|
||||||
|
@ -115,12 +115,12 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
},
|
},
|
||||||
leading: Icon(
|
leading: Icon(
|
||||||
Icons.add_circle_outline_rounded,
|
Icons.add_circle_outline_rounded,
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
'backup.create_new'.tr(),
|
'backup.create_new'.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -147,17 +147,17 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
},
|
},
|
||||||
leading: Icon(
|
leading: Icon(
|
||||||
Icons.manage_history_outlined,
|
Icons.manage_history_outlined,
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
'backup.autobackup_period_title'.tr(),
|
'backup.autobackup_period_title'.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
autobackupPeriod != null
|
autobackupPeriod != null
|
||||||
? 'backup.autobackup_period_subtitle'.tr(
|
? 'backup.autobackup_period_subtitle'.tr(
|
||||||
|
@ -191,18 +191,18 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
},
|
},
|
||||||
leading: Icon(
|
leading: Icon(
|
||||||
Icons.key_outlined,
|
Icons.key_outlined,
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
'backup.backups_encryption_key'.tr(),
|
'backup.backups_encryption_key'.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'backup.backups_encryption_key_subtitle'.tr(),
|
'backup.backups_encryption_key_subtitle'.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -250,12 +250,12 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: Icon(
|
leading: Icon(
|
||||||
Icons.error_outline,
|
Icons.error_outline,
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
'backup.no_backups'.tr(),
|
'backup.no_backups'.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -310,13 +310,13 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
},
|
},
|
||||||
title: Text(
|
title: Text(
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
'${MaterialLocalizations.of(context).formatShortDate(backup.time)} ${TimeOfDay.fromDateTime(backup.time).format(context)}',
|
'${MaterialLocalizations.of(context).formatShortDate(backup.time)} ${TimeOfDay.fromDateTime(backup.time).format(context)}',
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
service?.displayName ?? backup.fallbackServiceName,
|
service?.displayName ?? backup.fallbackServiceName,
|
||||||
),
|
),
|
||||||
|
@ -326,7 +326,7 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
height: 24,
|
height: 24,
|
||||||
width: 24,
|
width: 24,
|
||||||
colorFilter: ColorFilter.mode(
|
colorFilter: ColorFilter.mode(
|
||||||
getOverrideColor() ??
|
overrideColor ??
|
||||||
Theme.of(context)
|
Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
.onBackground,
|
.onBackground,
|
||||||
|
@ -335,7 +335,7 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
)
|
)
|
||||||
: Icon(
|
: Icon(
|
||||||
Icons.question_mark_outlined,
|
Icons.question_mark_outlined,
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -377,18 +377,18 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
title: Text(
|
title: Text(
|
||||||
'backup.refetch_backups'.tr(),
|
'backup.refetch_backups'.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'backup.refetch_backups_subtitle'.tr(),
|
'backup.refetch_backups_subtitle'.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
leading: Icon(
|
leading: Icon(
|
||||||
Icons.cached_outlined,
|
Icons.cached_outlined,
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
onTap: preventActions
|
onTap: preventActions
|
||||||
? null
|
? null
|
||||||
|
@ -401,18 +401,18 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
title: Text(
|
title: Text(
|
||||||
'backup.reupload_key'.tr(),
|
'backup.reupload_key'.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'backup.reupload_key_subtitle'.tr(),
|
'backup.reupload_key_subtitle'.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
leading: Icon(
|
leading: Icon(
|
||||||
Icons.warning_amber_outlined,
|
Icons.warning_amber_outlined,
|
||||||
color: getOverrideColor(),
|
color: overrideColor,
|
||||||
),
|
),
|
||||||
onTap: preventActions
|
onTap: preventActions
|
||||||
? null
|
? null
|
||||||
|
|
Loading…
Reference in a new issue