diff --git a/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/backup_and_restore_settings.dart b/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/backup_and_restore_settings.dart index 6ab82401b..8b74f8d40 100644 --- a/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/backup_and_restore_settings.dart +++ b/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/backup_and_restore_settings.dart @@ -2,6 +2,7 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:stackwallet/pages_desktop_specific/home/settings_menu/backup_and_restore/enable_backup_dialog.dart'; import 'package:stackwallet/pages_desktop_specific/home/settings_menu/backup_and_restore/restore_backup_dialog.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -9,8 +10,6 @@ import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'enable_backup_dialog.dart'; - class BackupRestoreSettings extends ConsumerStatefulWidget { const BackupRestoreSettings({Key? key}) : super(key: key); diff --git a/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/create_auto_backup.dart b/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/create_auto_backup.dart index 39b77cfea..0c8c47c9e 100644 --- a/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/create_auto_backup.dart +++ b/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/create_auto_backup.dart @@ -32,13 +32,27 @@ class _CreateAutoBackup extends State { bool get fieldsMatch => passphraseController.text == passphraseRepeatController.text; - List> get dropdownItems { - List> menuItems = [ - DropdownMenuItem( - child: Text("Every 10 minutes"), value: "Every 10 minutes"), - ]; - return menuItems; - } + String _currentDropDownValue = "Every 10 minutes"; + + final List _dropDOwnItems = [ + "Every 10 minutes", + "Every 20 minutes", + "Every 30 minutes", + ]; + + // List> get dropdownItems { + // List> menuItems = [ + // const DropdownMenuItem( + // value: "Every 10 minutes", + // child: Text("Every 10 minutes"), + // ), + // const DropdownMenuItem( + // value: "Every 20 minutes", + // child: Text("Every 20 minutes"), + // ), + // ]; + // return menuItems; + // } @override void initState() { @@ -50,7 +64,7 @@ class _CreateAutoBackup extends State { passphraseFocusNode = FocusNode(); passphraseRepeatFocusNode = FocusNode(); - // super.initState(); + super.initState(); } @override @@ -63,7 +77,7 @@ class _CreateAutoBackup extends State { passphraseFocusNode.dispose(); passphraseRepeatFocusNode.dispose(); - // super.dispose(); + super.dispose(); } @override @@ -114,7 +128,7 @@ class _CreateAutoBackup extends State { ), Container( alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 32), + padding: const EdgeInsets.only(left: 32), child: Text( "Choose file location", style: STextStyles.desktopTextExtraSmall(context).copyWith( @@ -123,7 +137,7 @@ class _CreateAutoBackup extends State { textAlign: TextAlign.left, ), ), - SizedBox( + const SizedBox( height: 10, ), Padding( @@ -177,12 +191,12 @@ class _CreateAutoBackup extends State { ), ), ), - SizedBox( + const SizedBox( height: 24, ), Container( alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 32), + padding: const EdgeInsets.only(left: 32), child: Text( "Create a passphrase", style: STextStyles.desktopTextExtraSmall(context).copyWith( @@ -191,11 +205,11 @@ class _CreateAutoBackup extends State { textAlign: TextAlign.left, ), ), - SizedBox( + const SizedBox( height: 10, ), Padding( - padding: EdgeInsets.only( + padding: const EdgeInsets.only( left: 32, right: 32, ), @@ -338,11 +352,24 @@ class _CreateAutoBackup extends State { const SizedBox( height: 10, ), - // DropdownButton( - // value: dropdownItems, - // items: dropdownItems, - // onChanged: null, - // ), + DropdownButton( + value: _currentDropDownValue, + items: _dropDOwnItems + .map( + (e) => DropdownMenuItem( + value: e, + child: Text(e), + ), + ) + .toList(), + onChanged: (value) { + if (value is String) { + setState(() { + _currentDropDownValue = value; + }); + } + }, + ), const Spacer(), Padding( padding: const EdgeInsets.all(32),