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/draggable_switch_button.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/secondary_button.dart';
import 'package:stackwallet/widgets/rounded_container.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
import 'package:url_launcher/url_launcher.dart';
@ -149,62 +151,81 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
),
)
: DesktopDialog(
maxHeight: 270,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 32),
maxHeight: double.infinity,
maxWidth: 580,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.only(
left: 32,
),
child: Text(
"Disable Auto Backup",
style: STextStyles.desktopH3(context),
),
const SizedBox(height: 24),
),
const DesktopDialogCloseButton(),
],
),
Padding(
padding: const EdgeInsets.only(
left: 32,
right: 32,
bottom: 32,
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 600,
child: Text(
"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.",
style: STextStyles.desktopTextSmall(context).copyWith(
"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.",
style: STextStyles.desktopTextSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
),
),
),
const Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SecondaryButton(
width: 248,
desktopMed: true,
enabled: true,
label: "Back",
onPressed: () {
Navigator.of(context).pop();
},
const SizedBox(
height: 48,
),
const SizedBox(width: 20),
PrimaryButton(
width: 248,
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,
enabled: true,
label: "Disable",
onPressed: () {
Navigator.of(context).pop();
setState(() {
ref
.watch(prefsChangeNotifierProvider)
.read(prefsChangeNotifierProvider)
.isAutoBackupEnabled = false;
});
Navigator.of(context).pop();
},
)
),
),
],
),
],
),
),
],
),
);
},
);
@ -372,25 +393,20 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
RoundedContainer(
width: 403,
color: Theme.of(context)
.extension<StackColors>()!
.background,
child: Padding(
padding:
const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text(
"Backed up ${prettySinceLastBackupString(ref.watch(prefsChangeNotifierProvider.select((value) => value.lastAutoBackup)))}",
style: STextStyles
.itemSubtitle(
style:
STextStyles.itemSubtitle(
context),
),
BlueTextButton(
@ -404,9 +420,6 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
),
],
),
],
),
),
),
const SizedBox(
height: 20,