WIP: showing textfields for backups

This commit is contained in:
ryleedavis 2022-11-04 14:19:53 -06:00
parent a6c380592e
commit 2c935d65b6

View file

@ -2,6 +2,8 @@ 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/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/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';
@ -24,9 +26,16 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
@override
Widget build(BuildContext context) {
debugPrint("BUILD: $runtimeType");
return ListView(
shrinkWrap: true,
return LayoutBuilder(builder: (context, constraints) {
return SingleChildScrollView(
scrollDirection: Axis.vertical,
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: constraints.maxHeight,
),
child: IntrinsicHeight(
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(
@ -50,21 +59,22 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
children: [
TextSpan(
text: "Auto Backup",
style: STextStyles.desktopTextSmall(context),
style:
STextStyles.desktopTextSmall(context),
),
TextSpan(
text:
"\n\nAuto backup is a custom Stack Wallet feature that offers a convenient backup of your data."
"To ensure maximum security, we recommend using a unique password that you haven't used anywhere "
"else on the internet before. Your password is not stored.",
style:
STextStyles.desktopTextExtraExtraSmall(context),
style: STextStyles
.desktopTextExtraExtraSmall(context),
),
TextSpan(
text:
"\n\nFor more information, please see our website ",
style:
STextStyles.desktopTextExtraExtraSmall(context),
style: STextStyles
.desktopTextExtraExtraSmall(context),
),
TextSpan(
text: "stackwallet.com",
@ -73,8 +83,10 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
recognizer: TapGestureRecognizer()
..onTap = () {
launchUrl(
Uri.parse("https://stackwallet.com/"),
mode: LaunchMode.externalApplication,
Uri.parse(
"https://stackwallet.com/"),
mode:
LaunchMode.externalApplication,
);
},
),
@ -124,15 +136,16 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
children: [
TextSpan(
text: "Manual Backup",
style: STextStyles.desktopTextSmall(context),
style:
STextStyles.desktopTextSmall(context),
),
TextSpan(
text:
"\n\nCreate manual backup to easily transfer your data between devices. "
"You will create a backup file that can be later used in the Restore option. "
"Use a strong password to encrypt your data.",
style:
STextStyles.desktopTextExtraExtraSmall(context),
style: STextStyles
.desktopTextExtraExtraSmall(context),
),
],
),
@ -146,7 +159,7 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
padding: EdgeInsets.all(
10,
),
child: ManualBackupButton(),
child: CreateBackupView(),
),
],
),
@ -180,14 +193,15 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
children: [
TextSpan(
text: "Restore Backup",
style: STextStyles.desktopTextSmall(context),
style:
STextStyles.desktopTextSmall(context),
),
TextSpan(
text:
"\n\nUse your Stack Wallet backup file to restore your wallets, address book "
"and wallet preferences.",
style:
STextStyles.desktopTextExtraExtraSmall(context),
style: STextStyles
.desktopTextExtraExtraSmall(context),
),
],
),
@ -201,7 +215,7 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
padding: EdgeInsets.all(
10,
),
child: RestoreBackupButton(),
child: RestoreFromFileView(),
),
],
),
@ -210,7 +224,10 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
),
),
],
);
),
),
));
});
}
}