Fix: reload home page after cesium wallet creation
This commit is contained in:
parent
de18062b7a
commit
7c7f604585
|
@ -13,6 +13,7 @@ class ChangePinProvider with ChangeNotifier {
|
||||||
try {
|
try {
|
||||||
final _dewif = chestBox.get(configBox.get('currentChest')).dewif;
|
final _dewif = chestBox.get(configBox.get('currentChest')).dewif;
|
||||||
|
|
||||||
|
// TODO: Durt: Detect if CesiumWallet
|
||||||
NewWallet newWalletFile = Dewif().changePassword(
|
NewWallet newWalletFile = Dewif().changePassword(
|
||||||
dewif: _dewif,
|
dewif: _dewif,
|
||||||
oldPassword: _oldPin.toUpperCase(),
|
oldPassword: _oldPin.toUpperCase(),
|
||||||
|
|
|
@ -4,6 +4,7 @@ import 'package:flutter/services.dart';
|
||||||
import 'package:gecko/globals.dart';
|
import 'package:gecko/globals.dart';
|
||||||
import 'package:gecko/models/generate_wallets.dart';
|
import 'package:gecko/models/generate_wallets.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:gecko/models/my_wallets.dart';
|
||||||
import 'package:gecko/models/wallet_data.dart';
|
import 'package:gecko/models/wallet_data.dart';
|
||||||
import 'package:gecko/models/wallet_options.dart';
|
import 'package:gecko/models/wallet_options.dart';
|
||||||
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
||||||
|
@ -21,6 +22,8 @@ class ImportWalletScreen extends StatelessWidget {
|
||||||
Provider.of<GenerateWalletsProvider>(context, listen: false);
|
Provider.of<GenerateWalletsProvider>(context, listen: false);
|
||||||
WalletOptionsProvider _walletOptions =
|
WalletOptionsProvider _walletOptions =
|
||||||
Provider.of<WalletOptionsProvider>(context, listen: false);
|
Provider.of<WalletOptionsProvider>(context, listen: false);
|
||||||
|
MyWalletsProvider _myWalletProvider =
|
||||||
|
Provider.of<MyWalletsProvider>(context);
|
||||||
|
|
||||||
_generateWalletProvider.pin.text = randomSecretCode(5);
|
_generateWalletProvider.pin.text = randomSecretCode(5);
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
|
@ -177,7 +180,7 @@ class ImportWalletScreen extends StatelessWidget {
|
||||||
? () async {
|
? () async {
|
||||||
final chestKey =
|
final chestKey =
|
||||||
await walletProvider.importCesiumWallet();
|
await walletProvider.importCesiumWallet();
|
||||||
walletProvider.reloadBuild();
|
_myWalletProvider.rebuildWidget();
|
||||||
|
|
||||||
await Navigator.pushAndRemoveUntil(
|
await Navigator.pushAndRemoveUntil(
|
||||||
context,
|
context,
|
||||||
|
|
|
@ -32,6 +32,7 @@ class UnlockingWallet extends StatelessWidget {
|
||||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
WalletOptionsProvider _walletOptions =
|
WalletOptionsProvider _walletOptions =
|
||||||
Provider.of<WalletOptionsProvider>(context);
|
Provider.of<WalletOptionsProvider>(context);
|
||||||
|
final double statusBarHeight = MediaQuery.of(context).padding.top;
|
||||||
|
|
||||||
int _pinLenght;
|
int _pinLenght;
|
||||||
ChestData currentChest = chestBox.get(configBox.get('currentChest'));
|
ChestData currentChest = chestBox.get(configBox.get('currentChest'));
|
||||||
|
@ -47,71 +48,88 @@ class UnlockingWallet extends StatelessWidget {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
// backgroundColor: Colors.brown[600],
|
// backgroundColor: Colors.brown[600],
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Column(children: <Widget>[
|
child: Column(
|
||||||
Expanded(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Column(children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(height: isTall ? 100 : 20),
|
Stack(children: <Widget>[
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
|
Positioned(
|
||||||
currentChest.imageFile == null
|
top: statusBarHeight + 10,
|
||||||
? Image.asset(
|
left: 15,
|
||||||
'assets/chests/${currentChest.imageName}',
|
child: Builder(
|
||||||
width: isTall ? 130 : 100,
|
builder: (context) => IconButton(
|
||||||
)
|
key: const Key('popButton'),
|
||||||
: Image.file(
|
icon: const Icon(
|
||||||
currentChest.imageFile,
|
Icons.arrow_back,
|
||||||
width: isTall ? 130 : 100,
|
color: Colors.black,
|
||||||
),
|
size: 25,
|
||||||
const SizedBox(width: 5),
|
|
||||||
SizedBox(
|
|
||||||
width: 250,
|
|
||||||
child: Text(
|
|
||||||
currentChest.name,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 25,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w700),
|
|
||||||
)),
|
|
||||||
]),
|
|
||||||
SizedBox(height: 30 * ratio),
|
|
||||||
const SizedBox(
|
|
||||||
width: 400,
|
|
||||||
child: Text(
|
|
||||||
'Pour déverrouiller votre coffre, composez votre code secret à l’abri des lézards indiscrets :',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 19,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w400),
|
|
||||||
)),
|
|
||||||
SizedBox(height: 40 * ratio),
|
|
||||||
pinForm(context, _pinLenght, currentChest),
|
|
||||||
SizedBox(height: 3 * ratio),
|
|
||||||
InkWell(
|
|
||||||
key: const Key('chooseChest'),
|
|
||||||
onTap: () {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) {
|
|
||||||
return ChooseChest(action: action);
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: SizedBox(
|
|
||||||
width: 400,
|
|
||||||
height: 70,
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
'Changer de coffre',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 22,
|
|
||||||
color: orangeC,
|
|
||||||
fontWeight: FontWeight.w600),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)),
|
onPressed: () => Navigator.pop(context),
|
||||||
]),
|
),
|
||||||
),
|
),
|
||||||
]),
|
),Column(children: <Widget>[
|
||||||
|
SizedBox(height: isTall ? 100 : 20),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
currentChest.imageFile == null
|
||||||
|
? Image.asset(
|
||||||
|
'assets/chests/${currentChest.imageName}',
|
||||||
|
width: isTall ? 130 : 100,
|
||||||
|
)
|
||||||
|
: Image.file(
|
||||||
|
currentChest.imageFile,
|
||||||
|
width: isTall ? 130 : 100,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 5),
|
||||||
|
SizedBox(
|
||||||
|
width: 250,
|
||||||
|
child: Text(
|
||||||
|
currentChest.name,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 25,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w700),
|
||||||
|
)),
|
||||||
|
]),
|
||||||
|
SizedBox(height: 30 * ratio),
|
||||||
|
const SizedBox(
|
||||||
|
width: 400,
|
||||||
|
child: Text(
|
||||||
|
'Pour déverrouiller votre coffre, composez votre code secret à l’abri des lézards indiscrets :',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 19,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w400),
|
||||||
|
)),
|
||||||
|
SizedBox(height: 40 * ratio),
|
||||||
|
pinForm(context, _pinLenght, currentChest),
|
||||||
|
SizedBox(height: 3 * ratio),
|
||||||
|
InkWell(
|
||||||
|
key: const Key('chooseChest'),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) {
|
||||||
|
return ChooseChest(action: action);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
width: 400,
|
||||||
|
height: 70,
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
'Changer de coffre',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 22,
|
||||||
|
color: orangeC,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
]),
|
||||||
|
]),]),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ description: Pay with G1.
|
||||||
# pub.dev using `pub publish`. This is preferred for private packages.
|
# pub.dev using `pub publish`. This is preferred for private packages.
|
||||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
version: 0.0.4+1
|
version: 0.0.4+2
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.7.0 <3.0.0"
|
sdk: ">=2.7.0 <3.0.0"
|
||||||
|
|
Loading…
Reference in New Issue