mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-23 02:54:30 +00:00
commit
197eb9d148
12 changed files with 467 additions and 542 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 |
|
@ -11,6 +11,7 @@ import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:qr_flutter/qr_flutter.dart';
|
import 'package:qr_flutter/qr_flutter.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
||||||
|
import 'package:stackwallet/utilities/address_utils.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/clipboard_interface.dart';
|
import 'package:stackwallet/utilities/clipboard_interface.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
|
@ -101,25 +102,28 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
String query = "";
|
Map<String, String> queryParams = {};
|
||||||
|
|
||||||
if (amountString.isNotEmpty) {
|
if (amountString.isNotEmpty) {
|
||||||
query += "amount=$amountString";
|
queryParams["amount"] = amountString;
|
||||||
}
|
}
|
||||||
if (noteString.isNotEmpty) {
|
if (noteString.isNotEmpty) {
|
||||||
if (query.isNotEmpty) {
|
queryParams["message"] = noteString;
|
||||||
query += "&";
|
|
||||||
}
|
|
||||||
query += "message=$noteString";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final uri = Uri(
|
String receivingAddress = widget.receivingAddress;
|
||||||
scheme: widget.coin.uriScheme,
|
if ((widget.coin == Coin.bitcoincash ||
|
||||||
host: widget.receivingAddress,
|
widget.coin == Coin.bitcoincashTestnet) &&
|
||||||
query: query.isNotEmpty ? query : null,
|
receivingAddress.contains(":")) {
|
||||||
);
|
// remove cash addr prefix
|
||||||
|
receivingAddress = receivingAddress.split(":").sublist(1).join();
|
||||||
|
}
|
||||||
|
|
||||||
final uriString = uri.toString().replaceFirst("://", ":");
|
final uriString = AddressUtils.buildUriString(
|
||||||
|
widget.coin,
|
||||||
|
receivingAddress,
|
||||||
|
queryParams,
|
||||||
|
);
|
||||||
|
|
||||||
Logging.instance.log("Generated receiving QR code for: $uriString",
|
Logging.instance.log("Generated receiving QR code for: $uriString",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
|
@ -229,10 +233,21 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
isDesktop = Util.isDesktop;
|
isDesktop = Util.isDesktop;
|
||||||
_uriString = Uri(
|
|
||||||
scheme: widget.coin.uriScheme,
|
String receivingAddress = widget.receivingAddress;
|
||||||
host: widget.receivingAddress,
|
if ((widget.coin == Coin.bitcoincash ||
|
||||||
).toString().replaceFirst("://", ":");
|
widget.coin == Coin.bitcoincashTestnet) &&
|
||||||
|
receivingAddress.contains(":")) {
|
||||||
|
// remove cash addr prefix
|
||||||
|
receivingAddress = receivingAddress.split(":").sublist(1).join();
|
||||||
|
}
|
||||||
|
|
||||||
|
_uriString = AddressUtils.buildUriString(
|
||||||
|
widget.coin,
|
||||||
|
receivingAddress,
|
||||||
|
{},
|
||||||
|
);
|
||||||
|
|
||||||
amountController = TextEditingController();
|
amountController = TextEditingController();
|
||||||
noteController = TextEditingController();
|
noteController = TextEditingController();
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
|
@ -9,7 +9,7 @@ import 'package:stackwallet/notifications/show_flush_bar.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/helpers/stack_file_system.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/helpers/stack_file_system.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart';
|
||||||
import 'package:stackwallet/pages_desktop_specific/home/settings_menu/backup_and_restore/restore_backup_dialog.dart';
|
// import 'package:stackwallet/pages_desktop_specific/home/settings_menu/backup_and_restore/restore_backup_dialog.dart';
|
||||||
import 'package:stackwallet/route_generator.dart';
|
import 'package:stackwallet/route_generator.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
|
@ -20,6 +20,8 @@ import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_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/primary_button.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||||
import 'package:stackwallet/widgets/loading_indicator.dart';
|
import 'package:stackwallet/widgets/loading_indicator.dart';
|
||||||
|
@ -47,14 +49,14 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
|
||||||
bool hidePassword = true;
|
bool hidePassword = true;
|
||||||
|
|
||||||
Future<void> restoreBackupPopup(BuildContext context) async {
|
Future<void> restoreBackupPopup(BuildContext context) async {
|
||||||
await showDialog<dynamic>(
|
// await showDialog<dynamic>(
|
||||||
context: context,
|
// context: context,
|
||||||
useSafeArea: false,
|
// useSafeArea: false,
|
||||||
barrierDismissible: true,
|
// barrierDismissible: true,
|
||||||
builder: (context) {
|
// builder: (context) {
|
||||||
return const RestoreBackupDialog();
|
// return const RestoreBackupDialog();
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -500,14 +502,73 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await Navigator.of(context).push(
|
await showDialog<dynamic>(
|
||||||
RouteGenerator.getRoute(
|
context: context,
|
||||||
builder: (_) =>
|
useSafeArea: false,
|
||||||
StackRestoreProgressView(
|
barrierDismissible: true,
|
||||||
jsonString: jsonString,
|
builder: (context) {
|
||||||
),
|
return DesktopDialog(
|
||||||
),
|
maxHeight: 750,
|
||||||
);
|
maxWidth: 600,
|
||||||
|
child: LayoutBuilder(
|
||||||
|
builder: (context, constraints) {
|
||||||
|
return SingleChildScrollView(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minHeight:
|
||||||
|
constraints.maxHeight,
|
||||||
|
),
|
||||||
|
child: IntrinsicHeight(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets
|
||||||
|
.all(32),
|
||||||
|
child: Text(
|
||||||
|
"Restoring Stack Wallet",
|
||||||
|
style: STextStyles
|
||||||
|
.desktopH3(
|
||||||
|
context),
|
||||||
|
textAlign:
|
||||||
|
TextAlign
|
||||||
|
.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const DesktopDialogCloseButton(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 30,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets
|
||||||
|
.symmetric(
|
||||||
|
horizontal:
|
||||||
|
32),
|
||||||
|
child:
|
||||||
|
StackRestoreProgressView(
|
||||||
|
jsonString:
|
||||||
|
jsonString,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
@ -3,7 +3,6 @@ import 'dart:async';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:stackwallet/pages/home_view/home_view.dart';
|
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/dialogs/cancel_stack_restore_dialog.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/dialogs/cancel_stack_restore_dialog.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart';
|
||||||
|
@ -17,6 +16,8 @@ import 'package:stackwallet/utilities/enums/stack_restoring_status.dart';
|
||||||
import 'package:stackwallet/utilities/logger.dart';
|
import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
import 'package:stackwallet/widgets/icon_widgets/addressbook_icon.dart';
|
import 'package:stackwallet/widgets/icon_widgets/addressbook_icon.dart';
|
||||||
import 'package:stackwallet/widgets/loading_indicator.dart';
|
import 'package:stackwallet/widgets/loading_indicator.dart';
|
||||||
|
@ -39,6 +40,8 @@ class StackRestoreProgressView extends ConsumerStatefulWidget {
|
||||||
|
|
||||||
class _StackRestoreProgressViewState
|
class _StackRestoreProgressViewState
|
||||||
extends ConsumerState<StackRestoreProgressView> {
|
extends ConsumerState<StackRestoreProgressView> {
|
||||||
|
bool isDesktop = Util.isDesktop;
|
||||||
|
|
||||||
Future<void> _cancel() async {
|
Future<void> _cancel() async {
|
||||||
bool shouldPop = false;
|
bool shouldPop = false;
|
||||||
unawaited(showDialog<void>(
|
unawaited(showDialog<void>(
|
||||||
|
@ -79,10 +82,15 @@ class _StackRestoreProgressViewState
|
||||||
|
|
||||||
await SWB.cancelRestore();
|
await SWB.cancelRestore();
|
||||||
shouldPop = true;
|
shouldPop = true;
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
Navigator.of(context).popUntil(ModalRoute.withName(widget.fromFile
|
!isDesktop
|
||||||
? RestoreFromEncryptedStringView.routeName
|
? Navigator.of(context).popUntil(ModalRoute.withName(widget.fromFile
|
||||||
: StackBackupView.routeName));
|
? RestoreFromEncryptedStringView.routeName
|
||||||
|
: StackBackupView.routeName))
|
||||||
|
: Navigator.of(context).popUntil((_) => count++ >= 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,281 +187,289 @@ class _StackRestoreProgressViewState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return WillPopScope(
|
bool isDesktop = Util.isDesktop;
|
||||||
onWillPop: _onWillPop,
|
|
||||||
child: Scaffold(
|
return ConditionalParent(
|
||||||
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
|
condition: !isDesktop,
|
||||||
appBar: AppBar(
|
builder: (child) {
|
||||||
leading: AppBarBackButton(
|
return WillPopScope(
|
||||||
onPressed: () async {
|
onWillPop: _onWillPop,
|
||||||
if (FocusScope.of(context).hasFocus) {
|
child: Scaffold(
|
||||||
FocusScope.of(context).unfocus();
|
backgroundColor:
|
||||||
await Future<void>.delayed(const Duration(milliseconds: 75));
|
Theme.of(context).extension<StackColors>()!.background,
|
||||||
}
|
appBar: AppBar(
|
||||||
if (_success) {
|
leading: AppBarBackButton(
|
||||||
_addWalletsToHomeView();
|
onPressed: () async {
|
||||||
if (mounted) {
|
if (FocusScope.of(context).hasFocus) {
|
||||||
Navigator.of(context).pop();
|
FocusScope.of(context).unfocus();
|
||||||
}
|
await Future<void>.delayed(
|
||||||
} else {
|
const Duration(milliseconds: 75));
|
||||||
if (await _requestCancel()) {
|
}
|
||||||
await _cancel();
|
if (_success) {
|
||||||
}
|
_addWalletsToHomeView();
|
||||||
}
|
if (mounted) {
|
||||||
},
|
Navigator.of(context).pop();
|
||||||
),
|
}
|
||||||
title: Text(
|
} else {
|
||||||
"Restoring Stack wallet",
|
if (await _requestCancel()) {
|
||||||
style: STextStyles.navBarTitle(context),
|
await _cancel();
|
||||||
),
|
}
|
||||||
),
|
}
|
||||||
body: Padding(
|
},
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
left: 12,
|
|
||||||
top: 12,
|
|
||||||
right: 12,
|
|
||||||
),
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
left: 4,
|
|
||||||
top: 4,
|
|
||||||
right: 4,
|
|
||||||
bottom: 0,
|
|
||||||
),
|
),
|
||||||
child: Column(
|
title: Text(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
"Restoring Stack wallet",
|
||||||
children: [
|
style: STextStyles.navBarTitle(context),
|
||||||
Text(
|
),
|
||||||
"Settings",
|
),
|
||||||
style: STextStyles.itemSubtitle(context),
|
body: Padding(
|
||||||
),
|
padding: const EdgeInsets.only(
|
||||||
const SizedBox(
|
left: 12,
|
||||||
height: 12,
|
top: 12,
|
||||||
),
|
right: 12,
|
||||||
Consumer(
|
),
|
||||||
builder: (_, ref, __) {
|
child: child,
|
||||||
final state = ref.watch(stackRestoringUIStateProvider
|
),
|
||||||
.select((value) => value.preferences));
|
),
|
||||||
return RestoringItemCard(
|
);
|
||||||
left: SizedBox(
|
},
|
||||||
width: 32,
|
child: SingleChildScrollView(
|
||||||
height: 32,
|
child: Padding(
|
||||||
child: RoundedContainer(
|
padding: const EdgeInsets.only(
|
||||||
padding: const EdgeInsets.all(0),
|
left: 4,
|
||||||
|
top: 4,
|
||||||
|
right: 4,
|
||||||
|
bottom: 0,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"Settings",
|
||||||
|
style: STextStyles.itemSubtitle(context),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Consumer(
|
||||||
|
builder: (_, ref, __) {
|
||||||
|
final state = ref.watch(stackRestoringUIStateProvider
|
||||||
|
.select((value) => value.preferences));
|
||||||
|
return RestoringItemCard(
|
||||||
|
left: SizedBox(
|
||||||
|
width: 32,
|
||||||
|
height: 32,
|
||||||
|
child: RoundedContainer(
|
||||||
|
padding: const EdgeInsets.all(0),
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.buttonBackSecondary,
|
||||||
|
child: Center(
|
||||||
|
child: SvgPicture.asset(
|
||||||
|
Assets.svg.gear,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
.extension<StackColors>()!
|
.extension<StackColors>()!
|
||||||
.buttonBackSecondary,
|
.accentColorDark,
|
||||||
child: Center(
|
|
||||||
child: SvgPicture.asset(
|
|
||||||
Assets.svg.gear,
|
|
||||||
width: 16,
|
|
||||||
height: 16,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.extension<StackColors>()!
|
|
||||||
.accentColorDark,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
right: SizedBox(
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
child: _getIconForState(state),
|
|
||||||
),
|
|
||||||
title: "Preferences",
|
|
||||||
subTitle: state == StackRestoringStatus.failed
|
|
||||||
? Text(
|
|
||||||
"Something went wrong",
|
|
||||||
style: STextStyles.errorSmall(context),
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 12,
|
|
||||||
),
|
|
||||||
Consumer(
|
|
||||||
builder: (_, ref, __) {
|
|
||||||
final state = ref.watch(stackRestoringUIStateProvider
|
|
||||||
.select((value) => value.addressBook));
|
|
||||||
return RestoringItemCard(
|
|
||||||
left: SizedBox(
|
|
||||||
width: 32,
|
|
||||||
height: 32,
|
|
||||||
child: RoundedContainer(
|
|
||||||
padding: const EdgeInsets.all(0),
|
|
||||||
color: Theme.of(context)
|
|
||||||
.extension<StackColors>()!
|
|
||||||
.buttonBackSecondary,
|
|
||||||
child: Center(
|
|
||||||
child: AddressBookIcon(
|
|
||||||
width: 16,
|
|
||||||
height: 16,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.extension<StackColors>()!
|
|
||||||
.accentColorDark,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
right: SizedBox(
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
child: _getIconForState(state),
|
|
||||||
),
|
|
||||||
title: "Address book",
|
|
||||||
subTitle: state == StackRestoringStatus.failed
|
|
||||||
? Text(
|
|
||||||
"Something went wrong",
|
|
||||||
style: STextStyles.errorSmall(context),
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 12,
|
|
||||||
),
|
|
||||||
Consumer(
|
|
||||||
builder: (_, ref, __) {
|
|
||||||
final state = ref.watch(stackRestoringUIStateProvider
|
|
||||||
.select((value) => value.nodes));
|
|
||||||
return RestoringItemCard(
|
|
||||||
left: SizedBox(
|
|
||||||
width: 32,
|
|
||||||
height: 32,
|
|
||||||
child: RoundedContainer(
|
|
||||||
padding: const EdgeInsets.all(0),
|
|
||||||
color: Theme.of(context)
|
|
||||||
.extension<StackColors>()!
|
|
||||||
.buttonBackSecondary,
|
|
||||||
child: Center(
|
|
||||||
child: SvgPicture.asset(
|
|
||||||
Assets.svg.node,
|
|
||||||
width: 16,
|
|
||||||
height: 16,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.extension<StackColors>()!
|
|
||||||
.accentColorDark,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
right: SizedBox(
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
child: _getIconForState(state),
|
|
||||||
),
|
|
||||||
title: "Nodes",
|
|
||||||
subTitle: state == StackRestoringStatus.failed
|
|
||||||
? Text(
|
|
||||||
"Something went wrong",
|
|
||||||
style: STextStyles.errorSmall(context),
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 12,
|
|
||||||
),
|
|
||||||
Consumer(
|
|
||||||
builder: (_, ref, __) {
|
|
||||||
final state = ref.watch(stackRestoringUIStateProvider
|
|
||||||
.select((value) => value.trades));
|
|
||||||
return RestoringItemCard(
|
|
||||||
left: SizedBox(
|
|
||||||
width: 32,
|
|
||||||
height: 32,
|
|
||||||
child: RoundedContainer(
|
|
||||||
padding: const EdgeInsets.all(0),
|
|
||||||
color: Theme.of(context)
|
|
||||||
.extension<StackColors>()!
|
|
||||||
.buttonBackSecondary,
|
|
||||||
child: Center(
|
|
||||||
child: SvgPicture.asset(
|
|
||||||
Assets.svg.arrowRotate2,
|
|
||||||
width: 16,
|
|
||||||
height: 16,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.extension<StackColors>()!
|
|
||||||
.accentColorDark,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
right: SizedBox(
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
child: _getIconForState(state),
|
|
||||||
),
|
|
||||||
title: "Exchange history",
|
|
||||||
subTitle: state == StackRestoringStatus.failed
|
|
||||||
? Text(
|
|
||||||
"Something went wrong",
|
|
||||||
style: STextStyles.errorSmall(context),
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 16,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"Wallets",
|
|
||||||
style: STextStyles.itemSubtitle(context),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
...ref
|
|
||||||
.watch(stackRestoringUIStateProvider
|
|
||||||
.select((value) => value.walletStateProviders))
|
|
||||||
.values
|
|
||||||
.map(
|
|
||||||
(provider) => Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 4),
|
|
||||||
child: RestoringWalletCard(
|
|
||||||
provider: provider,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
),
|
||||||
height: 80,
|
right: SizedBox(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
child: _getIconForState(state),
|
||||||
|
),
|
||||||
|
title: "Preferences",
|
||||||
|
subTitle: state == StackRestoringStatus.failed
|
||||||
|
? Text(
|
||||||
|
"Something went wrong",
|
||||||
|
style: STextStyles.errorSmall(context),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Consumer(
|
||||||
|
builder: (_, ref, __) {
|
||||||
|
final state = ref.watch(stackRestoringUIStateProvider
|
||||||
|
.select((value) => value.addressBook));
|
||||||
|
return RestoringItemCard(
|
||||||
|
left: SizedBox(
|
||||||
|
width: 32,
|
||||||
|
height: 32,
|
||||||
|
child: RoundedContainer(
|
||||||
|
padding: const EdgeInsets.all(0),
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.buttonBackSecondary,
|
||||||
|
child: Center(
|
||||||
|
child: AddressBookIcon(
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.accentColorDark,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
right: SizedBox(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
child: _getIconForState(state),
|
||||||
|
),
|
||||||
|
title: "Address book",
|
||||||
|
subTitle: state == StackRestoringStatus.failed
|
||||||
|
? Text(
|
||||||
|
"Something went wrong",
|
||||||
|
style: STextStyles.errorSmall(context),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Consumer(
|
||||||
|
builder: (_, ref, __) {
|
||||||
|
final state = ref.watch(stackRestoringUIStateProvider
|
||||||
|
.select((value) => value.nodes));
|
||||||
|
return RestoringItemCard(
|
||||||
|
left: SizedBox(
|
||||||
|
width: 32,
|
||||||
|
height: 32,
|
||||||
|
child: RoundedContainer(
|
||||||
|
padding: const EdgeInsets.all(0),
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.buttonBackSecondary,
|
||||||
|
child: Center(
|
||||||
|
child: SvgPicture.asset(
|
||||||
|
Assets.svg.node,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.accentColorDark,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
right: SizedBox(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
child: _getIconForState(state),
|
||||||
|
),
|
||||||
|
title: "Nodes",
|
||||||
|
subTitle: state == StackRestoringStatus.failed
|
||||||
|
? Text(
|
||||||
|
"Something went wrong",
|
||||||
|
style: STextStyles.errorSmall(context),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Consumer(
|
||||||
|
builder: (_, ref, __) {
|
||||||
|
final state = ref.watch(stackRestoringUIStateProvider
|
||||||
|
.select((value) => value.trades));
|
||||||
|
return RestoringItemCard(
|
||||||
|
left: SizedBox(
|
||||||
|
width: 32,
|
||||||
|
height: 32,
|
||||||
|
child: RoundedContainer(
|
||||||
|
padding: const EdgeInsets.all(0),
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.buttonBackSecondary,
|
||||||
|
child: Center(
|
||||||
|
child: SvgPicture.asset(
|
||||||
|
Assets.svg.arrowRotate2,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.accentColorDark,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
right: SizedBox(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
child: _getIconForState(state),
|
||||||
|
),
|
||||||
|
title: "Exchange history",
|
||||||
|
subTitle: state == StackRestoringStatus.failed
|
||||||
|
? Text(
|
||||||
|
"Something went wrong",
|
||||||
|
style: STextStyles.errorSmall(context),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 16,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"Wallets",
|
||||||
|
style: STextStyles.itemSubtitle(context),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
...ref
|
||||||
|
.watch(stackRestoringUIStateProvider
|
||||||
|
.select((value) => value.walletStateProviders))
|
||||||
|
.values
|
||||||
|
.map(
|
||||||
|
(provider) => Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 4),
|
||||||
|
child: RestoringWalletCard(
|
||||||
|
provider: provider,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
const SizedBox(
|
||||||
|
height: 30,
|
||||||
),
|
),
|
||||||
),
|
SizedBox(
|
||||||
),
|
width: MediaQuery.of(context).size.width - 32,
|
||||||
),
|
child: TextButton(
|
||||||
floatingActionButton: SizedBox(
|
onPressed: () async {
|
||||||
width: MediaQuery.of(context).size.width - 32,
|
if (_success) {
|
||||||
child: TextButton(
|
Navigator.of(context).pop();
|
||||||
onPressed: () async {
|
} else {
|
||||||
if (_success) {
|
if (await _requestCancel()) {
|
||||||
_addWalletsToHomeView();
|
await _cancel();
|
||||||
Navigator.of(context)
|
}
|
||||||
.popUntil(ModalRoute.withName(HomeView.routeName));
|
}
|
||||||
} else {
|
},
|
||||||
if (await _requestCancel()) {
|
style: Theme.of(context)
|
||||||
await _cancel();
|
.extension<StackColors>()!
|
||||||
}
|
.getPrimaryEnabledButtonColor(context),
|
||||||
}
|
child: Text(
|
||||||
},
|
_success ? "OK" : "Cancel restore process",
|
||||||
style: Theme.of(context)
|
style: STextStyles.button(context).copyWith(
|
||||||
.extension<StackColors>()!
|
color: Theme.of(context)
|
||||||
.getPrimaryEnabledButtonColor(context),
|
.extension<StackColors>()!
|
||||||
child: Text(
|
.buttonTextPrimary,
|
||||||
_success ? "OK" : "Cancel restore process",
|
),
|
||||||
style: STextStyles.button(context).copyWith(
|
),
|
||||||
color: Theme.of(context)
|
),
|
||||||
.extension<StackColors>()!
|
|
||||||
.buttonTextPrimary,
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -5,6 +5,7 @@ import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:intl/intl.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/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/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/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/locale_provider.dart';
|
||||||
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
||||||
|
@ -36,7 +37,6 @@ class BackupRestoreSettings extends ConsumerStatefulWidget {
|
||||||
class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
|
class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
|
||||||
late bool createBackup = false;
|
late bool createBackup = false;
|
||||||
late bool restoreBackup = false;
|
late bool restoreBackup = false;
|
||||||
// late bool isEnabledAutoBackup;
|
|
||||||
|
|
||||||
final toggleController = DSBController();
|
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 {
|
Future<void> attemptDisable() async {
|
||||||
final result = await showDialog<bool?>(
|
final result = await showDialog<bool?>(
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -208,10 +219,25 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset(
|
Padding(
|
||||||
Assets.svg.backupAuto,
|
padding: const EdgeInsets.all(8.0),
|
||||||
width: 48,
|
child: Row(
|
||||||
height: 48,
|
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(
|
Center(
|
||||||
child: Row(
|
child: Row(
|
||||||
|
@ -338,7 +364,9 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
|
||||||
desktopMed: true,
|
desktopMed: true,
|
||||||
width: 190,
|
width: 190,
|
||||||
label: "Edit auto backup",
|
label: "Edit auto backup",
|
||||||
onPressed: () {},
|
onPressed: () {
|
||||||
|
createAutoBackup();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -362,11 +390,14 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset(
|
Padding(
|
||||||
Assets.svg.backupAdd,
|
padding: const EdgeInsets.all(8.0),
|
||||||
width: 48,
|
child: SvgPicture.asset(
|
||||||
height: 48,
|
Assets.svg.backupAdd,
|
||||||
alignment: Alignment.topLeft,
|
width: 48,
|
||||||
|
height: 48,
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Row(
|
child: Row(
|
||||||
|
@ -441,11 +472,14 @@ class _BackupRestoreSettings extends ConsumerState<BackupRestoreSettings> {
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset(
|
Padding(
|
||||||
Assets.svg.backupRestore,
|
padding: const EdgeInsets.all(8.0),
|
||||||
width: 48,
|
child: SvgPicture.asset(
|
||||||
height: 48,
|
Assets.svg.backupRestore,
|
||||||
alignment: Alignment.topLeft,
|
width: 48,
|
||||||
|
height: 48,
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|
|
@ -578,7 +578,9 @@ class _CreateAutoBackup extends ConsumerState<CreateAutoBackup> {
|
||||||
label: "Cancel",
|
label: "Cancel",
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
Navigator.of(context).popUntil((_) => count++ >= 2);
|
!isEnabledAutoBackup
|
||||||
|
? Navigator.of(context).popUntil((_) => count++ >= 2)
|
||||||
|
: Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,171 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_svg/svg.dart';
|
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
|
||||||
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
|
||||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
|
||||||
|
|
||||||
class RestoreBackupDialog extends StatelessWidget {
|
|
||||||
const RestoreBackupDialog({Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return DesktopDialog(
|
|
||||||
maxHeight: 750,
|
|
||||||
maxWidth: 600,
|
|
||||||
child: LayoutBuilder(
|
|
||||||
builder: (context, constraints) {
|
|
||||||
return SingleChildScrollView(
|
|
||||||
child: ConstrainedBox(
|
|
||||||
constraints: BoxConstraints(
|
|
||||||
minHeight: constraints.maxHeight,
|
|
||||||
),
|
|
||||||
child: IntrinsicHeight(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(32),
|
|
||||||
child: Text(
|
|
||||||
"Restoring Stack Wallet",
|
|
||||||
style: STextStyles.desktopH3(context),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const DesktopDialogCloseButton(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 30,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"Settings",
|
|
||||||
style: STextStyles.desktopTextExtraSmall(context)
|
|
||||||
.copyWith(
|
|
||||||
color: Theme.of(context)
|
|
||||||
.extension<StackColors>()!
|
|
||||||
.textDark3,
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 32, vertical: 12),
|
|
||||||
child: RoundedWhiteContainer(
|
|
||||||
borderColor: Theme.of(context)
|
|
||||||
.extension<StackColors>()!
|
|
||||||
.background,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
SvgPicture.asset(
|
|
||||||
Assets.svg.framedAddressBook,
|
|
||||||
width: 40,
|
|
||||||
height: 40,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
Text(
|
|
||||||
"Address Book",
|
|
||||||
style:
|
|
||||||
STextStyles.desktopTextSmall(context),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
|
|
||||||
///TODO: CHECKMARK ANIMATION
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 32, vertical: 12),
|
|
||||||
child: RoundedWhiteContainer(
|
|
||||||
borderColor: Theme.of(context)
|
|
||||||
.extension<StackColors>()!
|
|
||||||
.background,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
SvgPicture.asset(
|
|
||||||
Assets.svg.framedGear,
|
|
||||||
width: 40,
|
|
||||||
height: 40,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
Text(
|
|
||||||
"Preferences",
|
|
||||||
style:
|
|
||||||
STextStyles.desktopTextSmall(context),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
|
|
||||||
///TODO: CHECKMARK ANIMATION
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 30,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"Wallets",
|
|
||||||
style: STextStyles.desktopTextExtraSmall(context)
|
|
||||||
.copyWith(
|
|
||||||
color: Theme.of(context)
|
|
||||||
.extension<StackColors>()!
|
|
||||||
.textDark3,
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(32),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
SecondaryButton(
|
|
||||||
desktopMed: true,
|
|
||||||
width: 200,
|
|
||||||
label: "Cancel restore process",
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -69,6 +69,7 @@ class _SVG {
|
||||||
String get circleLanguage => "assets/svg/language-circle.svg";
|
String get circleLanguage => "assets/svg/language-circle.svg";
|
||||||
String get circleDollarSign => "assets/svg/dollar-sign-circle.svg";
|
String get circleDollarSign => "assets/svg/dollar-sign-circle.svg";
|
||||||
String get circleLock => "assets/svg/lock-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 disableButton => "assets/svg/Button.svg";
|
||||||
String get polygon => "assets/svg/Polygon.svg";
|
String get polygon => "assets/svg/Polygon.svg";
|
||||||
String get personaIncognito => "assets/svg/persona-incognito-1.svg";
|
String get personaIncognito => "assets/svg/persona-incognito-1.svg";
|
||||||
|
|
|
@ -132,7 +132,7 @@ extension CoinExt on Coin {
|
||||||
case Coin.litecoinTestNet:
|
case Coin.litecoinTestNet:
|
||||||
return "litecoin";
|
return "litecoin";
|
||||||
case Coin.bitcoincashTestnet:
|
case Coin.bitcoincashTestnet:
|
||||||
return "bitcoincash";
|
return "bchtest";
|
||||||
case Coin.firoTestNet:
|
case Coin.firoTestNet:
|
||||||
return "firo";
|
return "firo";
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
|
|
|
@ -298,6 +298,7 @@ flutter:
|
||||||
- assets/svg/persona-easy-1.svg
|
- assets/svg/persona-easy-1.svg
|
||||||
- assets/svg/persona-incognito-1.svg
|
- assets/svg/persona-incognito-1.svg
|
||||||
- assets/svg/Button.svg
|
- assets/svg/Button.svg
|
||||||
|
- assets/svg/enabled-button.svg
|
||||||
- assets/svg/lock-circle.svg
|
- assets/svg/lock-circle.svg
|
||||||
- assets/svg/dollar-sign-circle.svg
|
- assets/svg/dollar-sign-circle.svg
|
||||||
- assets/svg/language-circle.svg
|
- assets/svg/language-circle.svg
|
||||||
|
|
|
@ -1,43 +1,27 @@
|
||||||
import 'dart:async';
|
|
||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
import 'dart:core' as core;
|
import 'dart:core' as core;
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
|
||||||
import 'package:hive/hive.dart';
|
|
||||||
import 'package:hive_test/hive_test.dart';
|
|
||||||
import 'package:mockito/annotations.dart';
|
|
||||||
import 'package:mockito/mockito.dart';
|
|
||||||
|
|
||||||
import 'package:cw_core/monero_amount_format.dart';
|
|
||||||
import 'package:cw_core/node.dart';
|
import 'package:cw_core/node.dart';
|
||||||
import 'package:cw_core/pending_transaction.dart';
|
|
||||||
import 'package:cw_core/unspent_coins_info.dart';
|
import 'package:cw_core/unspent_coins_info.dart';
|
||||||
import 'package:cw_core/wallet_base.dart';
|
import 'package:cw_core/wallet_base.dart';
|
||||||
import 'package:cw_core/wallet_credentials.dart';
|
import 'package:cw_core/wallet_credentials.dart';
|
||||||
import 'package:cw_core/wallet_info.dart';
|
import 'package:cw_core/wallet_info.dart';
|
||||||
import 'package:cw_core/wallet_service.dart';
|
import 'package:cw_core/wallet_service.dart';
|
||||||
import 'package:cw_core/wallet_type.dart';
|
import 'package:cw_core/wallet_type.dart';
|
||||||
import 'package:cw_monero/api/wallet.dart';
|
|
||||||
import 'package:cw_monero/api/wallet_manager.dart' as monero_wallet_manager;
|
|
||||||
import 'package:cw_monero/pending_monero_transaction.dart';
|
|
||||||
import 'package:cw_monero/monero_wallet.dart';
|
import 'package:cw_monero/monero_wallet.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_libmonero/core/key_service.dart';
|
import 'package:flutter_libmonero/core/key_service.dart';
|
||||||
import 'package:flutter_libmonero/core/wallet_creation_service.dart';
|
import 'package:flutter_libmonero/core/wallet_creation_service.dart';
|
||||||
import 'package:flutter_libmonero/view_model/send/output.dart';
|
|
||||||
import 'package:flutter_libmonero/monero/monero.dart';
|
import 'package:flutter_libmonero/monero/monero.dart';
|
||||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:hive_test/hive_test.dart';
|
||||||
|
import 'package:mockito/annotations.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
|
|
||||||
|
|
||||||
import 'package:stackwallet/services/wallets.dart';
|
import 'package:stackwallet/services/wallets.dart';
|
||||||
|
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
|
||||||
import 'dart:developer' as developer;
|
|
||||||
|
|
||||||
// TODO trim down to the minimum imports above
|
// TODO trim down to the minimum imports above
|
||||||
|
|
||||||
|
@ -76,12 +60,6 @@ void main() async {
|
||||||
dirPath: '');
|
dirPath: '');
|
||||||
late WalletCredentials credentials;
|
late WalletCredentials credentials;
|
||||||
|
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
|
||||||
Directory appDir = (await getApplicationDocumentsDirectory());
|
|
||||||
if (Platform.isIOS) {
|
|
||||||
appDir = (await getLibraryDirectory());
|
|
||||||
}
|
|
||||||
|
|
||||||
monero.onStartup();
|
monero.onStartup();
|
||||||
|
|
||||||
bool hiveAdaptersRegistered = false;
|
bool hiveAdaptersRegistered = false;
|
||||||
|
@ -101,7 +79,8 @@ void main() async {
|
||||||
await wallets.put('currentWalletName', name);
|
await wallets.put('currentWalletName', name);
|
||||||
|
|
||||||
_walletInfoSource = await Hive.openBox<WalletInfo>(WalletInfo.boxName);
|
_walletInfoSource = await Hive.openBox<WalletInfo>(WalletInfo.boxName);
|
||||||
walletService = monero.createMoneroWalletService(_walletInfoSource);
|
walletService = monero
|
||||||
|
.createMoneroWalletService(_walletInfoSource as Box<WalletInfo>);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,38 +1,26 @@
|
||||||
import 'dart:async';
|
|
||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
import 'dart:core' as core;
|
import 'dart:core' as core;
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
|
||||||
import 'package:hive/hive.dart';
|
|
||||||
import 'package:hive_test/hive_test.dart';
|
|
||||||
import 'package:mockito/annotations.dart';
|
|
||||||
import 'package:mockito/mockito.dart';
|
|
||||||
|
|
||||||
import 'package:cw_core/monero_amount_format.dart';
|
|
||||||
import 'package:cw_core/node.dart';
|
import 'package:cw_core/node.dart';
|
||||||
import 'package:cw_core/pending_transaction.dart';
|
|
||||||
import 'package:cw_core/unspent_coins_info.dart';
|
import 'package:cw_core/unspent_coins_info.dart';
|
||||||
import 'package:cw_core/wallet_base.dart';
|
import 'package:cw_core/wallet_base.dart';
|
||||||
import 'package:cw_core/wallet_credentials.dart';
|
import 'package:cw_core/wallet_credentials.dart';
|
||||||
import 'package:cw_core/wallet_info.dart';
|
import 'package:cw_core/wallet_info.dart';
|
||||||
import 'package:cw_core/wallet_service.dart';
|
import 'package:cw_core/wallet_service.dart';
|
||||||
import 'package:cw_core/wallet_type.dart';
|
import 'package:cw_core/wallet_type.dart';
|
||||||
import 'package:cw_wownero/api/wallet.dart';
|
|
||||||
import 'package:cw_wownero/pending_wownero_transaction.dart';
|
|
||||||
import 'package:cw_wownero/wownero_wallet.dart';
|
import 'package:cw_wownero/wownero_wallet.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_libmonero/core/key_service.dart';
|
import 'package:flutter_libmonero/core/key_service.dart';
|
||||||
import 'package:flutter_libmonero/core/wallet_creation_service.dart';
|
import 'package:flutter_libmonero/core/wallet_creation_service.dart';
|
||||||
import 'package:flutter_libmonero/view_model/send/output.dart';
|
|
||||||
import 'package:flutter_libmonero/wownero/wownero.dart';
|
import 'package:flutter_libmonero/wownero/wownero.dart';
|
||||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
|
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:hive_test/hive_test.dart';
|
||||||
|
import 'package:mockito/annotations.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
|
||||||
|
|
||||||
import 'wownero_wallet_test_data.dart';
|
import 'wownero_wallet_test_data.dart';
|
||||||
|
|
||||||
|
@ -67,12 +55,6 @@ void main() async {
|
||||||
dirPath: '');
|
dirPath: '');
|
||||||
late WalletCredentials credentials;
|
late WalletCredentials credentials;
|
||||||
|
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
|
||||||
Directory appDir = (await getApplicationDocumentsDirectory());
|
|
||||||
if (Platform.isIOS) {
|
|
||||||
appDir = (await getLibraryDirectory());
|
|
||||||
}
|
|
||||||
|
|
||||||
wownero.onStartup();
|
wownero.onStartup();
|
||||||
|
|
||||||
bool hiveAdaptersRegistered = false;
|
bool hiveAdaptersRegistered = false;
|
||||||
|
@ -92,7 +74,8 @@ void main() async {
|
||||||
await wallets.put('currentWalletName', name);
|
await wallets.put('currentWalletName', name);
|
||||||
|
|
||||||
_walletInfoSource = await Hive.openBox<WalletInfo>(WalletInfo.boxName);
|
_walletInfoSource = await Hive.openBox<WalletInfo>(WalletInfo.boxName);
|
||||||
walletService = wownero.createWowneroWalletService(_walletInfoSource);
|
walletService = wownero
|
||||||
|
.createWowneroWalletService(_walletInfoSource as Box<WalletInfo>);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasThrown = false;
|
bool hasThrown = false;
|
||||||
|
|
Loading…
Reference in a new issue