disable swb auto backup desktop popup

This commit is contained in:
julian 2022-11-14 11:40:12 -06:00
parent e91c99883b
commit 29ec03fb87

View file

@ -19,8 +19,10 @@ import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart'; import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart'; import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/desktop/primary_button.dart';
import 'package:stackwallet/widgets/desktop/secondary_button.dart'; import 'package:stackwallet/widgets/desktop/secondary_button.dart';
import 'package:stackwallet/widgets/rounded_container.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart';
import 'package:stackwallet/widgets/stack_dialog.dart'; import 'package:stackwallet/widgets/stack_dialog.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@ -149,61 +151,80 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
), ),
) )
: DesktopDialog( : DesktopDialog(
maxHeight: 270, maxHeight: double.infinity,
child: Padding( maxWidth: 580,
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 32), child: Column(
child: Column( mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Row(
"Disable Auto Backup", mainAxisAlignment: MainAxisAlignment.spaceBetween,
style: STextStyles.desktopH3(context), children: [
), Padding(
const SizedBox(height: 24), padding: const EdgeInsets.only(
SizedBox( left: 32,
width: 600, ),
child: Text( child: Text(
"You are turning off Auto Backup. You can turn it back on at any time. " "Disable Auto Backup",
"Your previous Auto Backup file will not be deleted. Remember to backup your wallets " style: STextStyles.desktopH3(context),
"manually so you don't lose important information.",
style: STextStyles.desktopTextSmall(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
), ),
), ),
const DesktopDialogCloseButton(),
],
),
Padding(
padding: const EdgeInsets.only(
left: 32,
right: 32,
bottom: 32,
), ),
const Spacer(), child: Column(
Row( mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SecondaryButton( SizedBox(
width: 248, width: 600,
desktopMed: true, child: Text(
enabled: true, "You are turning off Auto Backup. You can turn it back on at any time. Your previous Auto Backup file will not be deleted. Remember to backup your wallets manually so you don't lose important information.",
label: "Back", style: STextStyles.desktopTextSmall(context)
onPressed: () { .copyWith(
Navigator.of(context).pop(); color: Theme.of(context)
}, .extension<StackColors>()!
.textDark3,
),
),
),
const SizedBox(
height: 48,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: SecondaryButton(
desktopMed: true,
label: "Cancel",
onPressed: Navigator.of(context).pop,
),
),
const SizedBox(width: 16),
Expanded(
child: PrimaryButton(
desktopMed: true,
label: "Disable",
onPressed: () {
ref
.read(prefsChangeNotifierProvider)
.isAutoBackupEnabled = false;
Navigator.of(context).pop();
},
),
),
],
), ),
const SizedBox(width: 20),
PrimaryButton(
width: 248,
desktopMed: true,
enabled: true,
label: "Disable",
onPressed: () {
Navigator.of(context).pop();
setState(() {
ref
.watch(prefsChangeNotifierProvider)
.isAutoBackupEnabled = false;
});
},
)
], ],
), ),
], ),
), ],
), ),
); );
}, },
@ -372,40 +393,32 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Container( RoundedContainer(
width: 403, width: 403,
color: Theme.of(context) color: Theme.of(context)
.extension<StackColors>()! .extension<StackColors>()!
.background, .background,
child: Padding( child: Row(
padding: mainAxisAlignment:
const EdgeInsets.all(8.0), MainAxisAlignment
child: Column( .spaceBetween,
children: [ children: [
Row( Text(
mainAxisAlignment: "Backed up ${prettySinceLastBackupString(ref.watch(prefsChangeNotifierProvider.select((value) => value.lastAutoBackup)))}",
MainAxisAlignment style:
.spaceBetween, STextStyles.itemSubtitle(
children: [ context),
Text( ),
"Backed up ${prettySinceLastBackupString(ref.watch(prefsChangeNotifierProvider.select((value) => value.lastAutoBackup)))}", BlueTextButton(
style: STextStyles text: "Back up now",
.itemSubtitle( onTap: () {
context), ref
), .read(
BlueTextButton( autoSWBServiceProvider)
text: "Back up now", .doBackup();
onTap: () { },
ref ),
.read( ],
autoSWBServiceProvider)
.doBackup();
},
),
],
),
],
),
), ),
), ),
const SizedBox( const SizedBox(