Backup stuff.

This commit is contained in:
M
2021-01-15 19:41:30 +02:00
parent 9a79fcdc23
commit 47ceac2dd6
24 changed files with 459 additions and 253 deletions
+18 -4
View File
@@ -1,7 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:esys_flutter_share/esys_flutter_share.dart';
import 'package:cake_wallet/utils/show_bar.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
@@ -34,7 +36,7 @@ class BackupPage extends BasePage {
Center(
child: Container(
padding: EdgeInsets.only(left: 20, right: 20),
height: 225,
height: 300,
child: Column(children: [
Text(
'Backup password:',
@@ -43,9 +45,21 @@ class BackupPage extends BasePage {
Padding(
padding: EdgeInsets.only(top: 20, bottom: 10),
child: Observer(
builder: (_) => Text(
backupViewModelBase.backupPassword,
style: TextStyle(fontSize: 26),
builder: (_) => GestureDetector(
onTap: () {
Clipboard.setData(ClipboardData(
text:
backupViewModelBase.backupPassword));
showBar<void>(
context,
S.of(context).transaction_details_copied(
'Backup password'));
},
child: Text(
backupViewModelBase.backupPassword,
style: TextStyle(fontSize: 26),
textAlign: TextAlign.center,
),
))),
Padding(
padding: EdgeInsets.all(20),
@@ -84,5 +84,6 @@ class RestoreFromBackupPage extends BasePage {
}
await restoreFromBackupViewModel.import(textEditingController.text);
textEditingController.text = '';
}
}
@@ -1,4 +1,3 @@
import 'package:cake_wallet/entities/wallet_type.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/routes.dart';
import 'package:flutter/cupertino.dart';
@@ -7,10 +6,9 @@ import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/generated/i18n.dart';
class RestoreOptionsPage extends BasePage {
RestoreOptionsPage({@required this.type});
RestoreOptionsPage();
static const _aspectRatioImage = 2.086;
final WalletType type;
@override
String get title => S.current.restore_restore_wallet;
@@ -21,33 +19,30 @@ class RestoreOptionsPage extends BasePage {
@override
Widget body(BuildContext context) {
return Container(
width: double.infinity,
height: double.infinity,
padding: EdgeInsets.all(24),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
RestoreButton(
onPressed: () =>
Navigator.pushNamed(
context, Routes.restoreWalletOptionsFromWelcome),
image: imageSeedKeys,
title: S.of(context).restore_title_from_seed_keys,
description: S.of(context).restore_description_from_seed_keys
),
Padding(
padding: EdgeInsets.only(top: 24),
child: RestoreButton(
onPressed: () => Navigator.pushNamed(
context, Routes.restoreFromBackup),
image: imageBackup,
title: S.of(context).restore_title_from_backup,
description: S.of(context).restore_description_from_backup
),
)
],
),
)
);
width: double.infinity,
height: double.infinity,
padding: EdgeInsets.all(24),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
RestoreButton(
onPressed: () =>
Navigator.pushNamed(context, Routes.restoreWalletOptionsFromWelcome),
image: imageSeedKeys,
title: S.of(context).restore_title_from_seed_keys,
description:
S.of(context).restore_description_from_seed_keys),
Padding(
padding: EdgeInsets.only(top: 24),
child: RestoreButton(
onPressed: () =>
Navigator.pushNamed(context, Routes.restoreFromBackup),
image: imageBackup,
title: S.of(context).restore_title_from_backup,
description: S.of(context).restore_description_from_backup),
)
],
),
));
}
}
+1 -1
View File
@@ -160,7 +160,7 @@ class WelcomePage extends BasePage {
child: PrimaryImageButton(
onPressed: () =>
Navigator.pushNamed(context,
Routes.restoreWalletOptionsFromWelcome),
Routes.restoreOptions),
image: restoreWalletImage,
text: S
.of(context)
+1 -1
View File
@@ -18,7 +18,7 @@ class TrailButton extends StatelessWidget {
caption,
style: TextStyle(
color:
Theme.of(context).accentTextTheme.display4.decorationColor,
Theme.of(context).accentTextTheme.bodyText2.color,
fontWeight: FontWeight.w500,
fontSize: 14),
),