mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-03 17:40:43 +00:00
Change screen for new wallets for monero.com app
This commit is contained in:
parent
ff7700aa1f
commit
800c3ec14a
4 changed files with 19 additions and 7 deletions
|
@ -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:flutter/services.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:cake_wallet/wallet_type_utils.dart';
|
||||
|
||||
RouteSettings currentRouteSettings;
|
||||
|
||||
|
@ -80,9 +81,13 @@ Route<dynamic> createRoute(RouteSettings settings) {
|
|||
case Routes.newWalletFromWelcome:
|
||||
return CupertinoPageRoute<void>(
|
||||
builder: (_) => getIt.get<SetupPinCodePage>(
|
||||
param1: (PinCodeState<PinCodeWidget> context, dynamic _) =>
|
||||
Navigator.of(context.context)
|
||||
.pushNamed(Routes.newWalletType)),
|
||||
param1: (PinCodeState<PinCodeWidget> context, dynamic _) {
|
||||
if (isMoneroOnly) {
|
||||
Navigator.of(context.context).pushNamed(Routes.newWallet, arguments: WalletType.monero);
|
||||
} else {
|
||||
Navigator.of(context.context).pushNamed(Routes.newWalletType);
|
||||
}
|
||||
}),
|
||||
fullscreenDialog: true);
|
||||
|
||||
case Routes.newWalletType:
|
||||
|
|
|
@ -60,7 +60,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
|||
_stateReaction ??=
|
||||
reaction((_) => _walletNewVM.state, (ExecutionState state) {
|
||||
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) {
|
||||
|
|
|
@ -173,8 +173,13 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
EdgeInsets.only(bottom: 24, right: 24, left: 24),
|
||||
bottomSection: Column(children: <Widget>[
|
||||
PrimaryImageButton(
|
||||
onPressed: () =>
|
||||
Navigator.of(context).pushNamed(Routes.newWalletType),
|
||||
onPressed: () {
|
||||
if (isMoneroOnly) {
|
||||
Navigator.of(context).pushNamed(Routes.newWallet, arguments: WalletType.monero);
|
||||
} else {
|
||||
Navigator.of(context).pushNamed(Routes.newWalletType);
|
||||
}
|
||||
},
|
||||
image: newWalletImage,
|
||||
text: S.of(context).wallet_list_create_new_wallet,
|
||||
color: Theme.of(context).accentTextTheme.body2.color,
|
||||
|
|
|
@ -35,7 +35,9 @@ abstract class WalletCreationVMBase with Store {
|
|||
Future<void> create({dynamic options}) async {
|
||||
try {
|
||||
state = IsExecutingState();
|
||||
name = await generateName();
|
||||
if (name?.isEmpty ?? true) {
|
||||
name = await generateName();
|
||||
}
|
||||
final dirPath = await pathForWalletDir(name: name, type: type);
|
||||
final path = await pathForWallet(name: name, type: type);
|
||||
final credentials = getCredentials(options);
|
||||
|
|
Loading…
Reference in a new issue