chore: refresh backup stats when entering backup page (#21977)

* chore: refresh backup stats when entering backup page

* check for success status

* remove logs

* remove sync remote when toggle the button

* show status immediately after navigating to screen

* pr feedback
This commit is contained in:
Alex 2025-09-18 15:36:43 -05:00 committed by GitHub
parent dcbc266b83
commit d36c26bf97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 57 additions and 7 deletions

View file

@ -8,8 +8,17 @@ class BackupInfoCard extends StatelessWidget {
final String title;
final String subtitle;
final String info;
final VoidCallback? onTap;
const BackupInfoCard({super.key, required this.title, required this.subtitle, required this.info, this.onTap});
final bool isLoading;
const BackupInfoCard({
super.key,
required this.title,
required this.subtitle,
required this.info,
this.onTap,
this.isLoading = false,
});
@override
Widget build(BuildContext context) {
@ -38,8 +47,36 @@ class BackupInfoCard extends StatelessWidget {
trailing: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(info, style: context.textTheme.titleLarge),
Text("backup_info_card_assets", style: context.textTheme.labelLarge).tr(),
Stack(
children: [
Text(
info,
style: context.textTheme.titleLarge?.copyWith(
color: context.colorScheme.onSurface.withAlpha(isLoading ? 50 : 255),
),
),
if (isLoading)
Positioned.fill(
child: Align(
alignment: Alignment.center,
child: SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator(
strokeWidth: 2,
color: context.colorScheme.onSurface.withAlpha(150),
),
),
),
),
],
),
Text(
"backup_info_card_assets",
style: context.textTheme.labelLarge?.copyWith(
color: context.colorScheme.onSurface.withAlpha(isLoading ? 50 : 255),
),
).tr(),
],
),
),