feat: Implement visible accent when backup modal buttons are disabled #326

Merged
inex merged 3 commits from gray-backups into master 2023-09-08 15:42:19 +03:00
1 changed files with 60 additions and 9 deletions

View File

@ -83,6 +83,9 @@ class BackupDetailsPage extends StatelessWidget {
);
}
final Color? overrideColor =
NaiJi marked this conversation as resolved Outdated

You are making 20 calls of this lambda to get effectively the same color value. Could you reduce the calls to one, so you calculate the color only once per rebuild?

You are making 20 calls of this lambda to get effectively the same color value. Could you reduce the calls to one, so you calculate the color only once per rebuild?
preventActions ? Theme.of(context).colorScheme.secondary : null;
return BrandHeroScreen(
heroIcon: BrandIcons.save,
heroTitle: 'backup.card_title'.tr(),
@ -110,11 +113,15 @@ class BackupDetailsPage extends StatelessWidget {
),
);
},
leading: const Icon(
leading: Icon(
Icons.add_circle_outline_rounded,
color: overrideColor,
),
title: Text(
'backup.create_new'.tr(),
style: TextStyle(
color: overrideColor,
),
),
),
ListTile(
@ -138,13 +145,20 @@ class BackupDetailsPage extends StatelessWidget {
),
);
},
leading: const Icon(
leading: Icon(
Icons.manage_history_outlined,
color: overrideColor,
),
title: Text(
'backup.autobackup_period_title'.tr(),
style: TextStyle(
color: overrideColor,
),
),
subtitle: Text(
style: TextStyle(
color: overrideColor,
),
autobackupPeriod != null
? 'backup.autobackup_period_subtitle'.tr(
namedArgs: {
@ -175,14 +189,21 @@ class BackupDetailsPage extends StatelessWidget {
),
);
},
leading: const Icon(
leading: Icon(
Icons.key_outlined,
color: overrideColor,
),
title: Text(
'backup.backups_encryption_key'.tr(),
style: TextStyle(
color: overrideColor,
),
),
subtitle: Text(
'backup.backups_encryption_key_subtitle'.tr(),
style: TextStyle(
color: overrideColor,
),
),
),
const SizedBox(height: 8),
@ -227,10 +248,16 @@ class BackupDetailsPage extends StatelessWidget {
),
if (backups.isEmpty)
ListTile(
leading: const Icon(
leading: Icon(
Icons.error_outline,
color: overrideColor,
),
title: Text(
'backup.no_backups'.tr(),
style: TextStyle(
color: overrideColor,
),
),
title: Text('backup.no_backups'.tr()),
),
if (backups.isNotEmpty)
Column(
@ -282,9 +309,15 @@ class BackupDetailsPage extends StatelessWidget {
);
},
title: Text(
style: TextStyle(
color: overrideColor,
),
'${MaterialLocalizations.of(context).formatShortDate(backup.time)} ${TimeOfDay.fromDateTime(backup.time).format(context)}',
),
subtitle: Text(
style: TextStyle(
color: overrideColor,
),
service?.displayName ?? backup.fallbackServiceName,
),
leading: service != null
@ -293,12 +326,16 @@ class BackupDetailsPage extends StatelessWidget {
height: 24,
width: 24,
colorFilter: ColorFilter.mode(
Theme.of(context).colorScheme.onBackground,
overrideColor ??
Theme.of(context)
.colorScheme
.onBackground,
BlendMode.srcIn,
),
)
: const Icon(
: Icon(
Icons.question_mark_outlined,
color: overrideColor,
),
);
},
@ -339,12 +376,19 @@ class BackupDetailsPage extends StatelessWidget {
ListTile(
title: Text(
'backup.refetch_backups'.tr(),
style: TextStyle(
color: overrideColor,
),
),
subtitle: Text(
'backup.refetch_backups_subtitle'.tr(),
style: TextStyle(
color: overrideColor,
),
),
leading: const Icon(
leading: Icon(
Icons.cached_outlined,
color: overrideColor,
),
onTap: preventActions
? null
@ -356,12 +400,19 @@ class BackupDetailsPage extends StatelessWidget {
ListTile(
title: Text(
'backup.reupload_key'.tr(),
style: TextStyle(
color: overrideColor,
),
),
subtitle: Text(
'backup.reupload_key_subtitle'.tr(),
style: TextStyle(
color: overrideColor,
),
),
leading: const Icon(
leading: Icon(
Icons.warning_amber_outlined,
color: overrideColor,
),
onTap: preventActions
? null