mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-03 17:29:23 +00:00
desktop edit auto backup and enabled/disabled button
This commit is contained in:
parent
b635f1663b
commit
5f106efa4b
5 changed files with 59 additions and 17 deletions
4
assets/svg/enabled-button.svg
Normal file
4
assets/svg/enabled-button.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 6.2 KiB |
|
@ -5,6 +5,7 @@ import 'package:flutter_svg/flutter_svg.dart';
|
|||
import 'package:intl/intl.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/home/settings_menu/backup_and_restore/create_auto_backup.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/home/settings_menu/backup_and_restore/enable_backup_dialog.dart';
|
||||
import 'package:stackwallet/providers/global/locale_provider.dart';
|
||||
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
||||
|
@ -36,7 +37,6 @@ class BackupRestoreSettings extends ConsumerStatefulWidget {
|
|||
class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
|
||||
late bool createBackup = false;
|
||||
late bool restoreBackup = false;
|
||||
// late bool isEnabledAutoBackup;
|
||||
|
||||
final toggleController = DSBController();
|
||||
|
||||
|
@ -91,6 +91,17 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
|
|||
);
|
||||
}
|
||||
|
||||
Future<void> createAutoBackup() async {
|
||||
await showDialog<dynamic>(
|
||||
context: context,
|
||||
useSafeArea: false,
|
||||
barrierDismissible: true,
|
||||
builder: (context) {
|
||||
return CreateAutoBackup();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> attemptDisable() async {
|
||||
final result = await showDialog<bool?>(
|
||||
context: context,
|
||||
|
@ -208,10 +219,25 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
|
|||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
Assets.svg.backupAuto,
|
||||
width: 48,
|
||||
height: 48,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
Assets.svg.backupAuto,
|
||||
width: 48,
|
||||
height: 48,
|
||||
),
|
||||
isEnabledAutoBackup
|
||||
? SvgPicture.asset(
|
||||
Assets.svg.enableButton,
|
||||
)
|
||||
: SvgPicture.asset(
|
||||
Assets.svg.disableButton,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Row(
|
||||
|
@ -338,7 +364,9 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
|
|||
desktopMed: true,
|
||||
width: 190,
|
||||
label: "Edit auto backup",
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
createAutoBackup();
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
|
@ -362,11 +390,14 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
|
|||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
Assets.svg.backupAdd,
|
||||
width: 48,
|
||||
height: 48,
|
||||
alignment: Alignment.topLeft,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: SvgPicture.asset(
|
||||
Assets.svg.backupAdd,
|
||||
width: 48,
|
||||
height: 48,
|
||||
alignment: Alignment.topLeft,
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Row(
|
||||
|
@ -441,11 +472,14 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
|
|||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
Assets.svg.backupRestore,
|
||||
width: 48,
|
||||
height: 48,
|
||||
alignment: Alignment.topLeft,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: SvgPicture.asset(
|
||||
Assets.svg.backupRestore,
|
||||
width: 48,
|
||||
height: 48,
|
||||
alignment: Alignment.topLeft,
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Row(
|
||||
|
|
|
@ -578,7 +578,9 @@ class _CreateAutoBackup extends ConsumerState<CreateAutoBackup> {
|
|||
label: "Cancel",
|
||||
onPressed: () {
|
||||
int count = 0;
|
||||
Navigator.of(context).popUntil((_) => count++ >= 2);
|
||||
!isEnabledAutoBackup
|
||||
? Navigator.of(context).popUntil((_) => count++ >= 2)
|
||||
: Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
|
|
|
@ -69,6 +69,7 @@ class _SVG {
|
|||
String get circleLanguage => "assets/svg/language-circle.svg";
|
||||
String get circleDollarSign => "assets/svg/dollar-sign-circle.svg";
|
||||
String get circleLock => "assets/svg/lock-circle.svg";
|
||||
String get enableButton => "assets/svg/enabled-button.svg";
|
||||
String get disableButton => "assets/svg/Button.svg";
|
||||
String get polygon => "assets/svg/Polygon.svg";
|
||||
String get personaIncognito => "assets/svg/persona-incognito-1.svg";
|
||||
|
|
|
@ -298,6 +298,7 @@ flutter:
|
|||
- assets/svg/persona-easy-1.svg
|
||||
- assets/svg/persona-incognito-1.svg
|
||||
- assets/svg/Button.svg
|
||||
- assets/svg/enabled-button.svg
|
||||
- assets/svg/lock-circle.svg
|
||||
- assets/svg/dollar-sign-circle.svg
|
||||
- assets/svg/language-circle.svg
|
||||
|
|
Loading…
Reference in a new issue