diff --git a/lib/providers/substrate_sdk.dart b/lib/providers/substrate_sdk.dart index ef592c4..9ab49c1 100644 --- a/lib/providers/substrate_sdk.dart +++ b/lib/providers/substrate_sdk.dart @@ -229,6 +229,23 @@ class SubstrateSdk with ChangeNotifier { return await sdk.api.keyring.checkPassword(account, pass); } + Future getSeed(String address, String _pin) async { + final account = getKeypair(address); + keyring.setCurrent(account); + + final _seed = await sdk.api.keyring.getDecryptedSeed(keyring, _pin); + + String _seedText; + if (_seed == null) { + _seedText = ''; + } else { + _seedText = _seed.seed!.split('//')[0]; + } + + log.d(_seedText); + return _seedText; + } + int getDerivationNumber(String address) { final account = getKeypair(address); final deriveNbr = account.name!.split('//')[1]; diff --git a/lib/providers/wallet_options.dart b/lib/providers/wallet_options.dart index c60ef93..1ae0c36 100644 --- a/lib/providers/wallet_options.dart +++ b/lib/providers/wallet_options.dart @@ -85,8 +85,6 @@ class WalletOptionsProvider with ChangeNotifier { XFile? pickedFile = await picker.pickImage(source: ImageSource.gallery); if (pickedFile != null) { - ////TODO: Store image on disk, store path in walletBox.imagePath - File imageFile = File(pickedFile.path); if (!await imageDirectory.exists()) { log.e("Image folder doesn't exist"); diff --git a/lib/providers/wallets_profiles.dart b/lib/providers/wallets_profiles.dart index 70c9bd1..53b6c4b 100644 --- a/lib/providers/wallets_profiles.dart +++ b/lib/providers/wallets_profiles.dart @@ -242,7 +242,7 @@ class WalletsProfilesProvider with ChangeNotifier { snackCopyKey(context) { const snackBar = SnackBar( padding: EdgeInsets.all(20), - content: Text("Cette clé publique a été copié dans votre presse-papier.", + content: Text("Cette adresse a été copié dans votre presse-papier.", style: TextStyle(fontSize: 16)), duration: Duration(seconds: 2)); ScaffoldMessenger.of(context).showSnackBar(snackBar); diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 1aa3ed2..ec7ef45 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -539,7 +539,7 @@ Widget bubbleSpeak(String text, {double? long, Key? textKey}) { ? const BubbleEdges.all(20) : BubbleEdges.symmetric(horizontal: long, vertical: 30), elevation: 5, - color: Colors.white, + color: backgroundColor, child: Text( text, key: textKey, diff --git a/lib/screens/myWallets/chest_options.dart b/lib/screens/myWallets/chest_options.dart index ac0e209..5a4d7ee 100644 --- a/lib/screens/myWallets/chest_options.dart +++ b/lib/screens/myWallets/chest_options.dart @@ -6,6 +6,7 @@ import 'package:gecko/providers/chest_provider.dart'; import 'package:gecko/providers/home.dart'; import 'package:gecko/providers/my_wallets.dart'; import 'package:gecko/screens/myWallets/change_pin.dart'; +import 'package:gecko/screens/myWallets/show_seed.dart'; import 'package:provider/provider.dart'; class ChestOptions extends StatelessWidget { @@ -24,6 +25,7 @@ class ChestOptions extends StatelessWidget { ChestData currentChest = chestBox.get(configBox.get('currentChest'))!; return Scaffold( + backgroundColor: backgroundColor, resizeToAvoidBottomInset: false, appBar: AppBar( elevation: 1, @@ -46,6 +48,39 @@ class ChestOptions extends StatelessWidget { builder: (ctx) => SafeArea( child: Column(children: [ SizedBox(height: 30 * ratio), + InkWell( + key: const Key('showSeed'), + onTap: () async { + Navigator.push( + context, + MaterialPageRoute(builder: (context) { + return ShowSeed( + walletName: currentChest.name, + walletProvider: walletProvider, + ); + }), + ); + }, + child: SizedBox( + height: 50, + child: Row(children: [ + const SizedBox(width: 20), + Image.asset( + 'assets/onBoarding/phrase_de_restauration_flou.png', + width: 60, + ), + const SizedBox(width: 15), + Text( + 'Afficher ma phrase de restauration', + style: TextStyle( + fontSize: 20, + color: orangeC, + ), + ), + ]), + ), + ), + SizedBox(height: 10 * ratio), InkWell( key: const Key('changePin'), onTap: () async { diff --git a/lib/screens/myWallets/choose_chest.dart b/lib/screens/myWallets/choose_chest.dart index 0f09b48..5805e0c 100644 --- a/lib/screens/myWallets/choose_chest.dart +++ b/lib/screens/myWallets/choose_chest.dart @@ -34,6 +34,7 @@ class _ChooseChestState extends State { log.d(widget.action); return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/myWallets/choose_wallet.dart b/lib/screens/myWallets/choose_wallet.dart index 98a9347..1f6ebad 100644 --- a/lib/screens/myWallets/choose_wallet.dart +++ b/lib/screens/myWallets/choose_wallet.dart @@ -26,6 +26,7 @@ class ChooseWalletScreen extends StatelessWidget { SubstrateSdk _sub = Provider.of(context, listen: false); return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/myWallets/restore_chest.dart b/lib/screens/myWallets/restore_chest.dart index 3ac4833..f87601f 100644 --- a/lib/screens/myWallets/restore_chest.dart +++ b/lib/screens/myWallets/restore_chest.dart @@ -34,6 +34,7 @@ class RestoreChest extends StatelessWidget { return Future.value(true); }, child: Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, leading: IconButton( diff --git a/lib/screens/myWallets/show_seed.dart b/lib/screens/myWallets/show_seed.dart new file mode 100644 index 0000000..c05d794 --- /dev/null +++ b/lib/screens/myWallets/show_seed.dart @@ -0,0 +1,311 @@ +import 'dart:typed_data'; +import 'package:flutter/services.dart'; +import 'package:gecko/globals.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/providers/my_wallets.dart'; +import 'package:gecko/providers/substrate_sdk.dart'; +import 'package:gecko/screens/common_elements.dart'; +import 'package:pdf/pdf.dart'; +import 'package:printing/printing.dart'; +import 'package:provider/provider.dart'; +import 'package:pdf/widgets.dart' as pw; + +class ShowSeed extends StatelessWidget { + const ShowSeed( + {Key? keyMyWallets, + required this.walletName, + required this.walletProvider}) + : super(key: keyMyWallets); + final String? walletName; + final MyWalletsProvider walletProvider; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + // HomeProvider _homeProvider = Provider.of(context); + CommonElements common = CommonElements(); + + SubstrateSdk _sub = Provider.of(context, listen: false); + + final _chest = chestBox.get(configBox.get('currentChest')); + // _sub.changePassword( + // _chest!.address!, walletProvider.pinCode, newPin.text); + + return Scaffold( + backgroundColor: backgroundColor, + appBar: AppBar( + toolbarHeight: 60 * ratio, + title: const SizedBox( + height: 22, + child: Text('Ma phrase de restauration'), + )), + body: SafeArea( + child: Column(children: [ + const Spacer(flex: 1), + FutureBuilder( + future: _sub.getSeed(_chest!.address!, walletProvider.pinCode), + builder: (BuildContext context, AsyncSnapshot _seed) { + if (_seed.connectionState != ConnectionState.done || + _seed.hasError) { + return SizedBox( + height: 15, + width: 15, + child: CircularProgressIndicator( + color: orangeC, + strokeWidth: 2, + ), + ); + } else if (!_seed.hasData) { + return const Text(''); + } + + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Column(children: [ + common.buildText( + [ + const TextSpan( + text: + 'Tâchez de garder cette phrase bien secrète, car elle permet à quiconque la connaît d’accéder à tous vos portefeuilles.'), + ], + ), + SizedBox(height: 35 * ratio), + sentanceArray(context, _seed.data!.split(' ')), + const SizedBox(height: 20), + SizedBox( + height: 40, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + elevation: 1, + primary: orangeC, // background + onPrimary: Colors.black, // foreground + ), + onPressed: () { + Clipboard.setData( + ClipboardData(text: _seed.data)); + snackCopyKey(context); + }, + child: Row(children: [ + Image.asset( + 'assets/walletOptions/copy-white.png', + height: 25, + ), + const SizedBox(width: 7), + Text( + 'Copier', + style: TextStyle( + fontSize: 15, color: Colors.grey[50]), + ) + ]), + ), + ), + const SizedBox(height: 30), + GestureDetector( + onTap: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) { + return PrintWallet(_seed.data); + }), + ); + }, + child: Image.asset( + 'assets/printer.png', + height: 42 * ratio, + ), + ), + ]), + ]); + }), + const Spacer(flex: 3), + ]), + )); + } + + snackCopyKey(context) { + const snackBar = SnackBar( + padding: EdgeInsets.all(20), + content: Text( + "Votre phrase de restauration a été copié dans votre presse-papier.", + style: TextStyle(fontSize: 16)), + duration: Duration(seconds: 2)); + ScaffoldMessenger.of(context).showSnackBar(snackBar); + } + + Widget sentanceArray(BuildContext context, List _mnemonic) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 3), + child: Container( + constraints: const BoxConstraints(maxWidth: 450), + decoration: BoxDecoration( + border: Border.all(color: Colors.black), + color: const Color(0xffeeeedd), + borderRadius: const BorderRadius.all( + Radius.circular(10), + )), + padding: const EdgeInsets.all(20), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row(children: [ + arrayCell(_mnemonic[0], 1), + arrayCell(_mnemonic[1], 2), + arrayCell(_mnemonic[2], 3), + arrayCell(_mnemonic[3], 4), + ]), + const SizedBox(height: 15), + Row(children: [ + arrayCell(_mnemonic[4], 5), + arrayCell(_mnemonic[5], 6), + arrayCell(_mnemonic[6], 7), + arrayCell(_mnemonic[7], 8), + ]), + const SizedBox(height: 15), + Row(children: [ + arrayCell(_mnemonic[8], 9), + arrayCell(_mnemonic[9], 10), + arrayCell(_mnemonic[10], 11), + arrayCell(_mnemonic[11], 12), + ]), + ])), + ); + } + + Widget arrayCell(dataWord, int nbr) { + log.d(nbr); + + return SizedBox( + width: 100, + child: Column(children: [ + Text( + nbr.toString(), + style: + TextStyle(fontSize: 13 * ratio, color: const Color(0xff6b6b52)), + ), + Text( + dataWord, + key: Key('word$dataWord'), + style: TextStyle(fontSize: 17 * ratio, color: Colors.black), + ), + ]), + ); + } +} + +class PrintWallet extends StatelessWidget { + const PrintWallet(this.sentence, {Key? key}) : super(key: key); + + final String? sentence; + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + leading: IconButton( + icon: const Icon(Icons.arrow_back, color: Colors.black), + onPressed: () { + Navigator.pop(context); + }), + backgroundColor: yellowC, + foregroundColor: Colors.black, + toolbarHeight: 60 * ratio, + title: const SizedBox( + height: 22, + child: Text( + 'Imprimer ma phrase de restauration', + style: TextStyle(fontWeight: FontWeight.w600), + ), + ), + ), + body: PdfPreview( + canDebug: false, + canChangeOrientation: false, + build: (format) => printWallet(sentence!), + ), + ), + ); + } + + Future printWallet(String _seed) async { + final ByteData fontData = + await rootBundle.load("assets/OpenSans-Regular.ttf"); + final pw.Font ttf = pw.Font.ttf(fontData.buffer.asByteData()); + final pdf = pw.Document(); + int nbr = 1; + + final _seedList = _seed.split(' '); + + // const imageProvider = AssetImage('assets/icon/gecko_final.png'); + // final geckoLogo = await flutterImageProvider(imageProvider); + + pw.Widget arrayCell(String dataWord, int _nbr) { + nbr++; + + return pw.SizedBox( + width: 120, + child: pw.Column(children: [ + pw.Text( + _nbr.toString(), + style: pw.TextStyle( + fontSize: 15, color: const PdfColor(0.5, 0, 0), font: ttf), + ), + pw.Text( + dataWord, + style: pw.TextStyle( + fontSize: 20, color: const PdfColor(0, 0, 0), font: ttf), + ), + pw.SizedBox(height: 10) + ]), + ); + } + + pdf.addPage( + pw.Page( + pageFormat: PdfPageFormat.a4, + build: (context) { + return pw.Column( + // mainAxisAlignment: pw.MainAxisAlignment.center, + // mainAxisSize: pw.MainAxisSize.max, + // crossAxisAlignment: pw.CrossAxisAlignment.center, + children: [ + pw.Row(children: [ + arrayCell(_seedList[0], nbr), + arrayCell(_seedList[1], nbr), + arrayCell(_seedList[2], nbr), + arrayCell(_seedList[3], nbr), + ]), + pw.Row(children: [ + arrayCell(_seedList[4], nbr), + arrayCell(_seedList[5], nbr), + arrayCell(_seedList[6], nbr), + arrayCell(_seedList[7], nbr), + ]), + pw.Row(children: [ + arrayCell(_seedList[8], nbr), + arrayCell(_seedList[9], nbr), + arrayCell(_seedList[10], nbr), + arrayCell(_seedList[11], nbr) + ]), + pw.Expanded( + child: pw.Align( + alignment: pw.Alignment.bottomCenter, + child: pw.Text( + "Gardez cette feuille préciseusement, à l’abri des lézards indiscrets.", + style: pw.TextStyle(fontSize: 15, font: ttf), + ))) + ], + ); + }, + ), + ); + + return pdf.save(); + } +} diff --git a/lib/screens/myWallets/unlocking_wallet.dart b/lib/screens/myWallets/unlocking_wallet.dart index a898567..2b793e4 100644 --- a/lib/screens/myWallets/unlocking_wallet.dart +++ b/lib/screens/myWallets/unlocking_wallet.dart @@ -46,93 +46,93 @@ class UnlockingWallet extends StatelessWidget { errorController = StreamController(); return Scaffold( - // backgroundColor: Colors.brown[600], + backgroundColor: backgroundColor, body: SafeArea( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Stack(children: [ - Positioned( - top: 10, //statusBarHeight + 10, - left: 15, - child: Builder( - builder: (context) => IconButton( - key: const Key('popButton'), - icon: const Icon( - Icons.arrow_back, - color: Colors.black, - size: 30, - ), - onPressed: () => Navigator.pop(context), - ), - ), - ), - Column(children: [ - SizedBox(height: isTall ? 100 : 20), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - 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, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack(children: [ + Positioned( + top: 10, //statusBarHeight + 10, + left: 15, + child: Builder( + builder: (context) => IconButton( + key: const Key('popButton'), + icon: const Icon( + Icons.arrow_back, color: Colors.black, - fontWeight: FontWeight.w400), - )), - SizedBox(height: 40 * ratio), - pinForm(context, _pinLenght), - 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), + size: 30, ), + onPressed: () => Navigator.pop(context), ), - )), + ), + ), + Column(children: [ + SizedBox(height: isTall ? 100 : 20), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + 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), + 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), + ), + ), + )), + ]), + ]), ]), - ]), - ]), - )); + )); } Widget pinForm(context, _pinLenght) { diff --git a/lib/screens/myWallets/wallet_options.dart b/lib/screens/myWallets/wallet_options.dart index 704a98e..a940968 100644 --- a/lib/screens/myWallets/wallet_options.dart +++ b/lib/screens/myWallets/wallet_options.dart @@ -47,6 +47,7 @@ class WalletOptions extends StatelessWidget { return Future.value(true); }, child: Scaffold( + backgroundColor: backgroundColor, resizeToAvoidBottomInset: false, appBar: AppBar( toolbarHeight: 60 * ratio, @@ -84,7 +85,7 @@ class WalletOptions extends StatelessWidget { end: Alignment.bottomCenter, colors: [ yellowC, - const Color(0xfffafafa), + backgroundColor, ], )), child: Row( @@ -364,7 +365,7 @@ class WalletOptions extends StatelessWidget { onTap: !walletProvider.isDefaultWallet ? () async { defaultWallet = wallet; - await _sub.setCurrentWallet(wallet); + await _sub.setCurrentWallet(wallet); _myWalletProvider.readAllWallets(_currentChest); _myWalletProvider.rebuildWidget(); } diff --git a/lib/screens/myWallets/wallets_home.dart b/lib/screens/myWallets/wallets_home.dart index faeb14a..7cf4a3c 100644 --- a/lib/screens/myWallets/wallets_home.dart +++ b/lib/screens/myWallets/wallets_home.dart @@ -40,6 +40,7 @@ class WalletsHome extends StatelessWidget { return Future.value(true); }, child: Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( elevation: 1, toolbarHeight: 60 * ratio, @@ -244,14 +245,14 @@ class WalletsHome extends StatelessWidget { ), )), balanceBuilder(context, _repository.address!, - _repository.id()[1] == defaultWallet!.id()[1]), + _repository.address == defaultWallet!.address), ListTile( shape: const RoundedRectangleBorder( borderRadius: BorderRadius.vertical( bottom: Radius.circular(12))), // contentPadding: const EdgeInsets.only(left: 7.0), tileColor: - _repository.id()[1] == defaultWallet.id()[1] + _repository.address == defaultWallet.address ? orangeC : const Color(0xffFFD58D), // leading: Text('IMAGE'), diff --git a/lib/screens/onBoarding/1.dart b/lib/screens/onBoarding/1.dart index 2d8fba9..9d84922 100644 --- a/lib/screens/onBoarding/1.dart +++ b/lib/screens/onBoarding/1.dart @@ -13,6 +13,7 @@ class OnboardingStepOne extends StatelessWidget { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); CommonElements common = CommonElements(); return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/onBoarding/10.dart b/lib/screens/onBoarding/10.dart index 12f1204..5e71855 100644 --- a/lib/screens/onBoarding/10.dart +++ b/lib/screens/onBoarding/10.dart @@ -34,6 +34,7 @@ class OnboardingStepTen extends StatelessWidget { final int _pinLenght = _generateWalletProvider.pin.text.length; return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/onBoarding/11_congratulations.dart b/lib/screens/onBoarding/11_congratulations.dart index acf67c7..4c88d39 100644 --- a/lib/screens/onBoarding/11_congratulations.dart +++ b/lib/screens/onBoarding/11_congratulations.dart @@ -16,6 +16,7 @@ class OnboardingStepEleven extends StatelessWidget { CommonElements common = CommonElements(); return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/onBoarding/2.dart b/lib/screens/onBoarding/2.dart index 6f2d496..03c2bf8 100644 --- a/lib/screens/onBoarding/2.dart +++ b/lib/screens/onBoarding/2.dart @@ -15,6 +15,7 @@ class OnboardingStepTwo extends StatelessWidget { CommonElements common = CommonElements(); return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/onBoarding/3.dart b/lib/screens/onBoarding/3.dart index 7453e03..42bd197 100644 --- a/lib/screens/onBoarding/3.dart +++ b/lib/screens/onBoarding/3.dart @@ -15,6 +15,7 @@ class OnboardingStepThree extends StatelessWidget { CommonElements common = CommonElements(); return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/onBoarding/4.dart b/lib/screens/onBoarding/4.dart index 3b481a4..5b5d7d4 100644 --- a/lib/screens/onBoarding/4.dart +++ b/lib/screens/onBoarding/4.dart @@ -15,6 +15,7 @@ class OnboardingStepFor extends StatelessWidget { CommonElements common = CommonElements(); return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/onBoarding/5.dart b/lib/screens/onBoarding/5.dart index a495fe8..86a9e9f 100644 --- a/lib/screens/onBoarding/5.dart +++ b/lib/screens/onBoarding/5.dart @@ -26,6 +26,7 @@ class OnboardingStepFive extends StatelessWidget { CommonElements common = CommonElements(); return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/onBoarding/6.dart b/lib/screens/onBoarding/6.dart index c76ec4d..832019a 100644 --- a/lib/screens/onBoarding/6.dart +++ b/lib/screens/onBoarding/6.dart @@ -36,6 +36,7 @@ class OnboardingStepSix extends StatelessWidget { return Future.value(true); }, child: Scaffold( + backgroundColor: backgroundColor, resizeToAvoidBottomInset: false, extendBodyBehindAppBar: true, appBar: AppBar( diff --git a/lib/screens/onBoarding/7.dart b/lib/screens/onBoarding/7.dart index 1c0c96c..b430bf0 100644 --- a/lib/screens/onBoarding/7.dart +++ b/lib/screens/onBoarding/7.dart @@ -13,6 +13,7 @@ class OnboardingStepSeven extends StatelessWidget { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); CommonElements common = CommonElements(); return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/onBoarding/8.dart b/lib/screens/onBoarding/8.dart index 22b9fc2..4bcb744 100644 --- a/lib/screens/onBoarding/8.dart +++ b/lib/screens/onBoarding/8.dart @@ -13,6 +13,7 @@ class OnboardingStepEight extends StatelessWidget { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); CommonElements common = CommonElements(); return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/onBoarding/9.dart b/lib/screens/onBoarding/9.dart index b41dc2f..5dda878 100644 --- a/lib/screens/onBoarding/9.dart +++ b/lib/screens/onBoarding/9.dart @@ -25,6 +25,7 @@ class OnboardingStepNine extends StatelessWidget { : _generateWalletProvider.changePinCode(reload: false).toUpperCase(); return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/search.dart b/lib/screens/search.dart index 0538a1c..7d23b30 100644 --- a/lib/screens/search.dart +++ b/lib/screens/search.dart @@ -1,6 +1,7 @@ import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; import 'package:flutter/material.dart'; +// import 'package:gecko/providers/home.dart'; import 'package:gecko/providers/search.dart'; import 'package:gecko/screens/search_result.dart'; import 'package:provider/provider.dart'; @@ -15,6 +16,8 @@ class SearchScreen extends StatelessWidget { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); SearchProvider _searchProvider = Provider.of(context); final double screenHeight = MediaQuery.of(context).size.height; + // HomeProvider _homeProvider = + // Provider.of(context, listen: false); return WillPopScope( onWillPop: () { @@ -22,6 +25,8 @@ class SearchScreen extends StatelessWidget { return Future.value(true); }, child: Scaffold( + backgroundColor: backgroundColor, + appBar: AppBar( elevation: 1, toolbarHeight: 60 * ratio, @@ -36,6 +41,7 @@ class SearchScreen extends StatelessWidget { Navigator.of(context).pop(); }), ), + // bottomNavigationBar: _homeProvider.bottomAppBar(context), body: SafeArea( child: Column(children: [ SizedBox(height: isTall ? 200 : 100), diff --git a/lib/screens/search_result.dart b/lib/screens/search_result.dart index e837167..3f34899 100644 --- a/lib/screens/search_result.dart +++ b/lib/screens/search_result.dart @@ -30,6 +30,7 @@ class SearchResultScreen extends StatelessWidget { double _avatarSize = 55; return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( elevation: 1, toolbarHeight: 60 * ratio, diff --git a/lib/screens/settings.dart b/lib/screens/settings.dart index beab345..d58fbda 100644 --- a/lib/screens/settings.dart +++ b/lib/screens/settings.dart @@ -39,6 +39,7 @@ class SettingsScreen extends StatelessWidget { // getAppDirectory(); return Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( diff --git a/lib/screens/template_screen.dart b/lib/screens/template_screen.dart index faa92ec..84bc711 100644 --- a/lib/screens/template_screen.dart +++ b/lib/screens/template_screen.dart @@ -1,20 +1,18 @@ import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; import 'package:flutter/material.dart'; -// import 'package:gecko/models/home.dart'; -// import 'package:provider/provider.dart'; -// ignore: must_be_immutable class TemplateScreen extends StatelessWidget { - TextEditingController tplController = TextEditingController(); - - TemplateScreen({Key? key}) : super(key: key); + const TemplateScreen({Key? key}) : super(key: key); @override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); // HomeProvider _homeProvider = Provider.of(context); + return Scaffold( + backgroundColor: backgroundColor, + appBar: AppBar( toolbarHeight: 60 * ratio, title: const SizedBox( @@ -22,21 +20,10 @@ class TemplateScreen extends StatelessWidget { child: Text('Template screen'), )), body: SafeArea( - child: Column(children: [ - const SizedBox(height: 20), - TextField( - enabled: true, - controller: tplController, - maxLines: 1, - textAlign: TextAlign.center, - decoration: const InputDecoration( - contentPadding: EdgeInsets.all(15.0), - ), - style: const TextStyle( - fontSize: 22.0, - color: Colors.black, - fontWeight: FontWeight.w400)), - const SizedBox(height: 20), + child: Column(children: const [ + SizedBox(height: 20), + Text('data'), + SizedBox(height: 20), ]), )); } diff --git a/lib/screens/transaction_in_progress.dart b/lib/screens/transaction_in_progress.dart index 8cb179e..07ac2e3 100644 --- a/lib/screens/transaction_in_progress.dart +++ b/lib/screens/transaction_in_progress.dart @@ -87,6 +87,7 @@ class TransactionInProgress extends StatelessWidget { return Future.value(true); }, child: Scaffold( + backgroundColor: backgroundColor, appBar: AppBar( toolbarHeight: 60 * ratio, elevation: 0, diff --git a/lib/screens/wallet_view.dart b/lib/screens/wallet_view.dart index 6c8f805..308e6b0 100644 --- a/lib/screens/wallet_view.dart +++ b/lib/screens/wallet_view.dart @@ -40,6 +40,7 @@ class WalletViewScreen extends StatelessWidget { _sub.setCurrentWallet(defaultWallet!); return Scaffold( + backgroundColor: backgroundColor, resizeToAvoidBottomInset: true, appBar: AppBar( elevation: 0,