diff --git a/lib/ui/myWallets/confirmWalletStorage.dart b/lib/ui/myWallets/confirmWalletStorage.dart index 7bea54b..7d31d93 100644 --- a/lib/ui/myWallets/confirmWalletStorage.dart +++ b/lib/ui/myWallets/confirmWalletStorage.dart @@ -41,7 +41,11 @@ class ConfirmStoreWalletState extends State { Widget build(BuildContext context) { return Scaffold( resizeToAvoidBottomInset: false, - appBar: AppBar(), + appBar: AppBar( + title: SizedBox( + height: 25, + child: Text('Confirmez ce portefeuille'), + )), body: Center( child: Column(children: [ SizedBox(height: 15), @@ -96,8 +100,8 @@ class ConfirmStoreWalletState extends State { ), TextField( inputFormatters: [ - new FilteringTextInputFormatter.allow( - RegExp('[a-zA-Z|0-9|\\-|_]')), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z|0-9|\\-|_| ]')), ], enabled: isAskedWordValid, controller: this.walletName, @@ -201,7 +205,7 @@ class ConfirmStoreWalletState extends State { ), actions: [ TextButton( - child: Text('Approve'), + child: Text("J'ai compris"), onPressed: () { Navigator.of(context).pop(); }, diff --git a/lib/ui/myWallets/generateWalletsScreen.dart b/lib/ui/myWallets/generateWalletsScreen.dart index e05debc..44cc3dd 100644 --- a/lib/ui/myWallets/generateWalletsScreen.dart +++ b/lib/ui/myWallets/generateWalletsScreen.dart @@ -37,7 +37,11 @@ class GenerateWalletsState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(), + appBar: AppBar( + title: SizedBox( + height: 25, + child: Text('Générer un portefeuille'), + )), floatingActionButton: Container( height: 80.0, width: 80.0, diff --git a/lib/ui/myWallets/walletOptions.dart b/lib/ui/myWallets/walletOptions.dart index ff9d04b..c7b2065 100644 --- a/lib/ui/myWallets/walletOptions.dart +++ b/lib/ui/myWallets/walletOptions.dart @@ -36,7 +36,11 @@ class WalletOptionsState extends State { Widget build(BuildContext context) { return Scaffold( resizeToAvoidBottomInset: false, - appBar: AppBar(), + appBar: AppBar( + title: SizedBox( + height: 25, + child: Text(widget.walletName), + )), body: Center( child: SafeArea( child: Column(children: [ @@ -212,14 +216,53 @@ class WalletOptionsState extends State { final _walletFile = Directory('$appPath/wallets/$_name'); print('DELETE THAT ?: $_walletFile'); - _walletFile.deleteSync(recursive: true); - Navigator.pop(context); + final bool _answer = await _confirmDeletingWallet(); + + if (_answer) { + _walletFile.deleteSync(recursive: true); + Navigator.pop(context); + } return 0; } catch (e) { return 1; } } + Future _confirmDeletingWallet() async { + return showDialog( + context: context, + barrierDismissible: true, // user must tap button! + builder: (BuildContext context) { + return AlertDialog( + title: Text( + 'Êtes-vous sûr de vouloir supprimer le portefeuille ${widget.walletName} ?'), + content: SingleChildScrollView( + child: ListBody( + children: [ + Text( + 'Vous pourrez restaurer ce portefeuille à tout moment grace à votre phrase de restauration.'), + ], + ), + ), + actions: [ + TextButton( + child: Text("Non"), + onPressed: () { + Navigator.pop(context, false); + }, + ), + TextButton( + child: Text("Oui"), + onPressed: () { + Navigator.pop(context, true); + }, + ), + ], + ); + }, + ); + } + Future get _localPath async { final directory = await getApplicationDocumentsDirectory(); return directory.path;