Change screen for new wallets for monero.com app

This commit is contained in:
M 2022-01-03 20:25:48 +02:00
parent ff7700aa1f
commit 800c3ec14a
4 changed files with 19 additions and 7 deletions

View file

@ -67,6 +67,7 @@ import 'package:cake_wallet/src/screens/exchange_trade/exchange_confirm_page.dar
import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_page.dart'; import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_page.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
RouteSettings currentRouteSettings; RouteSettings currentRouteSettings;
@ -80,9 +81,13 @@ Route<dynamic> createRoute(RouteSettings settings) {
case Routes.newWalletFromWelcome: case Routes.newWalletFromWelcome:
return CupertinoPageRoute<void>( return CupertinoPageRoute<void>(
builder: (_) => getIt.get<SetupPinCodePage>( builder: (_) => getIt.get<SetupPinCodePage>(
param1: (PinCodeState<PinCodeWidget> context, dynamic _) => param1: (PinCodeState<PinCodeWidget> context, dynamic _) {
Navigator.of(context.context) if (isMoneroOnly) {
.pushNamed(Routes.newWalletType)), Navigator.of(context.context).pushNamed(Routes.newWallet, arguments: WalletType.monero);
} else {
Navigator.of(context.context).pushNamed(Routes.newWalletType);
}
}),
fullscreenDialog: true); fullscreenDialog: true);
case Routes.newWalletType: case Routes.newWalletType:

View file

@ -60,7 +60,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
_stateReaction ??= _stateReaction ??=
reaction((_) => _walletNewVM.state, (ExecutionState state) { reaction((_) => _walletNewVM.state, (ExecutionState state) {
if (state is ExecutedSuccessfullyState) { if (state is ExecutedSuccessfullyState) {
Navigator.of(context).pushNamed(Routes.seed, arguments: true); Navigator.of(context).pushNamed(Routes.preSeed, arguments: _walletNewVM.type);
} }
if (state is FailureState) { if (state is FailureState) {

View file

@ -173,8 +173,13 @@ class WalletListBodyState extends State<WalletListBody> {
EdgeInsets.only(bottom: 24, right: 24, left: 24), EdgeInsets.only(bottom: 24, right: 24, left: 24),
bottomSection: Column(children: <Widget>[ bottomSection: Column(children: <Widget>[
PrimaryImageButton( PrimaryImageButton(
onPressed: () => onPressed: () {
Navigator.of(context).pushNamed(Routes.newWalletType), if (isMoneroOnly) {
Navigator.of(context).pushNamed(Routes.newWallet, arguments: WalletType.monero);
} else {
Navigator.of(context).pushNamed(Routes.newWalletType);
}
},
image: newWalletImage, image: newWalletImage,
text: S.of(context).wallet_list_create_new_wallet, text: S.of(context).wallet_list_create_new_wallet,
color: Theme.of(context).accentTextTheme.body2.color, color: Theme.of(context).accentTextTheme.body2.color,

View file

@ -35,7 +35,9 @@ abstract class WalletCreationVMBase with Store {
Future<void> create({dynamic options}) async { Future<void> create({dynamic options}) async {
try { try {
state = IsExecutingState(); state = IsExecutingState();
name = await generateName(); if (name?.isEmpty ?? true) {
name = await generateName();
}
final dirPath = await pathForWalletDir(name: name, type: type); final dirPath = await pathForWalletDir(name: name, type: type);
final path = await pathForWallet(name: name, type: type); final path = await pathForWallet(name: name, type: type);
final credentials = getCredentials(options); final credentials = getCredentials(options);