mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
Merge remote-tracking branch 'origin/desktop' into desktop-testing
This commit is contained in:
commit
27b6f79b22
6 changed files with 388 additions and 467 deletions
|
@ -11,6 +11,7 @@ import 'package:path_provider/path_provider.dart';
|
|||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
import 'package:share_plus/share_plus.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/clipboard_interface.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
|
@ -101,25 +102,28 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
|
|||
return null;
|
||||
}
|
||||
|
||||
String query = "";
|
||||
Map<String, String> queryParams = {};
|
||||
|
||||
if (amountString.isNotEmpty) {
|
||||
query += "amount=$amountString";
|
||||
queryParams["amount"] = amountString;
|
||||
}
|
||||
if (noteString.isNotEmpty) {
|
||||
if (query.isNotEmpty) {
|
||||
query += "&";
|
||||
}
|
||||
query += "message=$noteString";
|
||||
queryParams["message"] = noteString;
|
||||
}
|
||||
|
||||
final uri = Uri(
|
||||
scheme: widget.coin.uriScheme,
|
||||
host: widget.receivingAddress,
|
||||
query: query.isNotEmpty ? query : null,
|
||||
);
|
||||
String receivingAddress = widget.receivingAddress;
|
||||
if ((widget.coin == Coin.bitcoincash ||
|
||||
widget.coin == Coin.bitcoincashTestnet) &&
|
||||
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",
|
||||
level: LogLevel.Info);
|
||||
|
@ -229,10 +233,21 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
|
|||
@override
|
||||
void initState() {
|
||||
isDesktop = Util.isDesktop;
|
||||
_uriString = Uri(
|
||||
scheme: widget.coin.uriScheme,
|
||||
host: widget.receivingAddress,
|
||||
).toString().replaceFirst("://", ":");
|
||||
|
||||
String receivingAddress = widget.receivingAddress;
|
||||
if ((widget.coin == Coin.bitcoincash ||
|
||||
widget.coin == Coin.bitcoincashTestnet) &&
|
||||
receivingAddress.contains(":")) {
|
||||
// remove cash addr prefix
|
||||
receivingAddress = receivingAddress.split(":").sublist(1).join();
|
||||
}
|
||||
|
||||
_uriString = AddressUtils.buildUriString(
|
||||
widget.coin,
|
||||
receivingAddress,
|
||||
{},
|
||||
);
|
||||
|
||||
amountController = TextEditingController();
|
||||
noteController = TextEditingController();
|
||||
super.initState();
|
||||
|
|
|
@ -20,6 +20,8 @@ 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/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/secondary_button.dart';
|
||||
import 'package:stackwallet/widgets/loading_indicator.dart';
|
||||
|
@ -500,14 +502,73 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
|
|||
return;
|
||||
}
|
||||
|
||||
await Navigator.of(context).push(
|
||||
RouteGenerator.getRoute(
|
||||
builder: (_) =>
|
||||
StackRestoreProgressView(
|
||||
jsonString: jsonString,
|
||||
),
|
||||
),
|
||||
);
|
||||
await showDialog<dynamic>(
|
||||
context: context,
|
||||
useSafeArea: false,
|
||||
barrierDismissible: true,
|
||||
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_riverpod/flutter_riverpod.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/helpers/restore_create_backup.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart';
|
||||
|
@ -18,6 +17,8 @@ import 'package:stackwallet/utilities/enums/stack_restoring_status.dart';
|
|||
import 'package:stackwallet/utilities/logger.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.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/icon_widgets/addressbook_icon.dart';
|
||||
import 'package:stackwallet/widgets/loading_indicator.dart';
|
||||
|
@ -40,6 +41,8 @@ class StackRestoreProgressView extends ConsumerStatefulWidget {
|
|||
|
||||
class _StackRestoreProgressViewState
|
||||
extends ConsumerState<StackRestoreProgressView> {
|
||||
bool isDesktop = Util.isDesktop;
|
||||
|
||||
Future<void> _cancel() async {
|
||||
bool shouldPop = false;
|
||||
unawaited(showDialog<void>(
|
||||
|
@ -80,10 +83,15 @@ class _StackRestoreProgressViewState
|
|||
|
||||
await SWB.cancelRestore();
|
||||
shouldPop = true;
|
||||
|
||||
int count = 0;
|
||||
|
||||
if (mounted) {
|
||||
Navigator.of(context).popUntil(ModalRoute.withName(widget.fromFile
|
||||
? RestoreFromEncryptedStringView.routeName
|
||||
: StackBackupView.routeName));
|
||||
!isDesktop
|
||||
? Navigator.of(context).popUntil(ModalRoute.withName(widget.fromFile
|
||||
? RestoreFromEncryptedStringView.routeName
|
||||
: StackBackupView.routeName))
|
||||
: Navigator.of(context).popUntil((_) => count++ >= 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,281 +189,289 @@ class _StackRestoreProgressViewState
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: _onWillPop,
|
||||
child: Scaffold(
|
||||
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
|
||||
appBar: AppBar(
|
||||
leading: AppBarBackButton(
|
||||
onPressed: () async {
|
||||
if (FocusScope.of(context).hasFocus) {
|
||||
FocusScope.of(context).unfocus();
|
||||
await Future<void>.delayed(const Duration(milliseconds: 75));
|
||||
}
|
||||
if (_success) {
|
||||
_addWalletsToHomeView();
|
||||
if (mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
} else {
|
||||
if (await _requestCancel()) {
|
||||
await _cancel();
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
title: Text(
|
||||
"Restoring Stack wallet",
|
||||
style: STextStyles.navBarTitle(context),
|
||||
),
|
||||
),
|
||||
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,
|
||||
bool isDesktop = Util.isDesktop;
|
||||
|
||||
return ConditionalParent(
|
||||
condition: !isDesktop,
|
||||
builder: (child) {
|
||||
return WillPopScope(
|
||||
onWillPop: _onWillPop,
|
||||
child: Scaffold(
|
||||
backgroundColor:
|
||||
Theme.of(context).extension<StackColors>()!.background,
|
||||
appBar: AppBar(
|
||||
leading: AppBarBackButton(
|
||||
onPressed: () async {
|
||||
if (FocusScope.of(context).hasFocus) {
|
||||
FocusScope.of(context).unfocus();
|
||||
await Future<void>.delayed(
|
||||
const Duration(milliseconds: 75));
|
||||
}
|
||||
if (_success) {
|
||||
_addWalletsToHomeView();
|
||||
if (mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
} else {
|
||||
if (await _requestCancel()) {
|
||||
await _cancel();
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
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),
|
||||
title: Text(
|
||||
"Restoring Stack wallet",
|
||||
style: STextStyles.navBarTitle(context),
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 12,
|
||||
top: 12,
|
||||
right: 12,
|
||||
),
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
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)
|
||||
.extension<StackColors>()!
|
||||
.buttonBackSecondary,
|
||||
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,
|
||||
.accentColorDark,
|
||||
),
|
||||
),
|
||||
),
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
floatingActionButton: SizedBox(
|
||||
width: MediaQuery.of(context).size.width - 32,
|
||||
child: TextButton(
|
||||
onPressed: () async {
|
||||
if (_success) {
|
||||
_addWalletsToHomeView();
|
||||
Navigator.of(context)
|
||||
.popUntil(ModalRoute.withName(HomeView.routeName));
|
||||
} else {
|
||||
if (await _requestCancel()) {
|
||||
await _cancel();
|
||||
}
|
||||
}
|
||||
},
|
||||
style: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.getPrimaryEnabledButtonColor(context),
|
||||
child: Text(
|
||||
_success ? "OK" : "Cancel restore process",
|
||||
style: STextStyles.button(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.buttonTextPrimary,
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width - 32,
|
||||
child: TextButton(
|
||||
onPressed: () async {
|
||||
if (_success) {
|
||||
Navigator.of(context).pop();
|
||||
} else {
|
||||
if (await _requestCancel()) {
|
||||
await _cancel();
|
||||
}
|
||||
}
|
||||
},
|
||||
style: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.getPrimaryEnabledButtonColor(context),
|
||||
child: Text(
|
||||
_success ? "OK" : "Cancel restore process",
|
||||
style: STextStyles.button(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.buttonTextPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -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();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
|
@ -132,7 +132,7 @@ extension CoinExt on Coin {
|
|||
case Coin.litecoinTestNet:
|
||||
return "litecoin";
|
||||
case Coin.bitcoincashTestnet:
|
||||
return "bitcoincash";
|
||||
return "bchtest";
|
||||
case Coin.firoTestNet:
|
||||
return "firo";
|
||||
case Coin.dogecoinTestNet:
|
||||
|
|
|
@ -11,7 +11,7 @@ description: Stack Wallet
|
|||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
version: 1.5.14+86
|
||||
version: 1.5.16+88
|
||||
|
||||
environment:
|
||||
sdk: ">=2.17.0 <3.0.0"
|
||||
|
|
Loading…
Reference in a new issue