mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 00:51:20 +00:00
feat: Implement visible accent when backup modal buttons are disabled
This commit is contained in:
parent
c5671cc767
commit
e07394e8b1
|
@ -83,6 +83,9 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color? getOverrideColor() =>
|
||||||
|
preventActions ? Theme.of(context).colorScheme.secondary : null;
|
||||||
|
|
||||||
return BrandHeroScreen(
|
return BrandHeroScreen(
|
||||||
heroIcon: BrandIcons.save,
|
heroIcon: BrandIcons.save,
|
||||||
heroTitle: 'backup.card_title'.tr(),
|
heroTitle: 'backup.card_title'.tr(),
|
||||||
|
@ -110,11 +113,15 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
leading: const Icon(
|
leading: Icon(
|
||||||
Icons.add_circle_outline_rounded,
|
Icons.add_circle_outline_rounded,
|
||||||
|
color: getOverrideColor(),
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
'backup.create_new'.tr(),
|
'backup.create_new'.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
|
@ -138,13 +145,20 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
leading: const Icon(
|
leading: Icon(
|
||||||
Icons.manage_history_outlined,
|
Icons.manage_history_outlined,
|
||||||
|
color: getOverrideColor(),
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
'backup.autobackup_period_title'.tr(),
|
'backup.autobackup_period_title'.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
|
style: TextStyle(
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
autobackupPeriod != null
|
autobackupPeriod != null
|
||||||
? 'backup.autobackup_period_subtitle'.tr(
|
? 'backup.autobackup_period_subtitle'.tr(
|
||||||
namedArgs: {
|
namedArgs: {
|
||||||
|
@ -175,14 +189,21 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
leading: const Icon(
|
leading: Icon(
|
||||||
Icons.key_outlined,
|
Icons.key_outlined,
|
||||||
|
color: getOverrideColor(),
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
'backup.backups_encryption_key'.tr(),
|
'backup.backups_encryption_key'.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'backup.backups_encryption_key_subtitle'.tr(),
|
'backup.backups_encryption_key_subtitle'.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
|
@ -227,10 +248,16 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
),
|
),
|
||||||
if (backups.isEmpty)
|
if (backups.isEmpty)
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(
|
leading: Icon(
|
||||||
Icons.error_outline,
|
Icons.error_outline,
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
'backup.no_backups'.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
title: Text('backup.no_backups'.tr()),
|
|
||||||
),
|
),
|
||||||
if (backups.isNotEmpty)
|
if (backups.isNotEmpty)
|
||||||
Column(
|
Column(
|
||||||
|
@ -282,9 +309,15 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
title: Text(
|
title: Text(
|
||||||
|
style: TextStyle(
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
'${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(
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
service?.displayName ?? backup.fallbackServiceName,
|
service?.displayName ?? backup.fallbackServiceName,
|
||||||
),
|
),
|
||||||
leading: service != null
|
leading: service != null
|
||||||
|
@ -293,12 +326,16 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
height: 24,
|
height: 24,
|
||||||
width: 24,
|
width: 24,
|
||||||
colorFilter: ColorFilter.mode(
|
colorFilter: ColorFilter.mode(
|
||||||
Theme.of(context).colorScheme.onBackground,
|
getOverrideColor() ??
|
||||||
|
Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.onBackground,
|
||||||
BlendMode.srcIn,
|
BlendMode.srcIn,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: const Icon(
|
: Icon(
|
||||||
Icons.question_mark_outlined,
|
Icons.question_mark_outlined,
|
||||||
|
color: getOverrideColor(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -339,12 +376,19 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
'backup.refetch_backups'.tr(),
|
'backup.refetch_backups'.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'backup.refetch_backups_subtitle'.tr(),
|
'backup.refetch_backups_subtitle'.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
leading: const Icon(
|
leading: Icon(
|
||||||
Icons.cached_outlined,
|
Icons.cached_outlined,
|
||||||
|
color: getOverrideColor(),
|
||||||
),
|
),
|
||||||
onTap: preventActions
|
onTap: preventActions
|
||||||
? null
|
? null
|
||||||
|
@ -356,12 +400,19 @@ class BackupDetailsPage extends StatelessWidget {
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
'backup.reupload_key'.tr(),
|
'backup.reupload_key'.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'backup.reupload_key_subtitle'.tr(),
|
'backup.reupload_key_subtitle'.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: getOverrideColor(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
leading: const Icon(
|
leading: Icon(
|
||||||
Icons.warning_amber_outlined,
|
Icons.warning_amber_outlined,
|
||||||
|
color: getOverrideColor(),
|
||||||
),
|
),
|
||||||
onTap: preventActions
|
onTap: preventActions
|
||||||
? null
|
? null
|
||||||
|
|
Loading…
Reference in a new issue