diff --git a/lib/providers/substrate_sdk.dart b/lib/providers/substrate_sdk.dart index ef592c492012a1d7dca26fc61b3af441a885865d..9ab49c161ed311681af52b8941842c20dfee3d50 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<String> 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 c60ef938b875d4ce76638752423ceed3ed3c717b..1ae0c36d675f1814e22459c3b9f163b5316ecefb 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 70c9bd141a6952a51390dbdad44038b63fb802c9..53b6c4bd9ea0c31070663cc2f0b1373cc8a3fe8a 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 1aa3ed2aa6ec3709bc3684280bea163acf7919f6..ec7ef45741c5d844a71b84072f8b0bd86bd6eed0 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 ac0e2090cad5d9268637191d4c290f9a95eb9f89..5a4d7eec66e316fd1329293b83263ae3772b7e5e 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: <Widget>[ 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: <Widget>[ + 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 0f09b48dd59f7a6419954304a4b6e627b48a2bf6..5805e0c5287997a495c9dd761e5417246337d7f1 100644 --- a/lib/screens/myWallets/choose_chest.dart +++ b/lib/screens/myWallets/choose_chest.dart @@ -34,6 +34,7 @@ class _ChooseChestState extends State<ChooseChest> { 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 98a934761d3c3176a8b13f69793b0c84555c8f3e..1f6ebad19eeeb49bcd705be8acf77fced6553ad9 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<SubstrateSdk>(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 3ac4833668776d040204491bab879b01d895e7f7..f87601fce58061647e6f2590bff613602933fc81 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<bool>.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 0000000000000000000000000000000000000000..c05d794276fc991083605ecf45886d51a584e5a9 --- /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<HomeProvider>(context); + CommonElements common = CommonElements(); + + SubstrateSdk _sub = Provider.of<SubstrateSdk>(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: <Widget>[ + const Spacer(flex: 1), + FutureBuilder( + future: _sub.getSeed(_chest!.address!, walletProvider.pinCode), + builder: (BuildContext context, AsyncSnapshot<String?> _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( + <TextSpan>[ + 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: <Widget>[ + 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: <Widget>[ + Row(children: <Widget>[ + arrayCell(_mnemonic[0], 1), + arrayCell(_mnemonic[1], 2), + arrayCell(_mnemonic[2], 3), + arrayCell(_mnemonic[3], 4), + ]), + const SizedBox(height: 15), + Row(children: <Widget>[ + arrayCell(_mnemonic[4], 5), + arrayCell(_mnemonic[5], 6), + arrayCell(_mnemonic[6], 7), + arrayCell(_mnemonic[7], 8), + ]), + const SizedBox(height: 15), + Row(children: <Widget>[ + 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: <Widget>[ + 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<Uint8List> 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.Widget>[ + 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.Widget>[ + pw.Row(children: <pw.Widget>[ + arrayCell(_seedList[0], nbr), + arrayCell(_seedList[1], nbr), + arrayCell(_seedList[2], nbr), + arrayCell(_seedList[3], nbr), + ]), + pw.Row(children: <pw.Widget>[ + arrayCell(_seedList[4], nbr), + arrayCell(_seedList[5], nbr), + arrayCell(_seedList[6], nbr), + arrayCell(_seedList[7], nbr), + ]), + pw.Row(children: <pw.Widget>[ + 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 a898567893a10c620b1edc300472515ed51772ff..2b793e4aab01dfd8838dbf1e4397f68169223638 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<ErrorAnimationType>(); return Scaffold( - // backgroundColor: Colors.brown[600], + backgroundColor: backgroundColor, body: SafeArea( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: <Widget>[ - Stack(children: <Widget>[ - 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, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: <Widget>[ + Stack(children: <Widget>[ + 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), + ), ), - 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), - 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( + 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( - 'Changer de coffre', + 'Pour déverrouiller votre coffre, composez votre code secret à l’abri des lézards indiscrets :', style: TextStyle( - fontSize: 22, - color: orangeC, - fontWeight: FontWeight.w600), - ), - ), - )), + 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 704a98e4fd297faff84d8be933f3c7cf617fcfc7..a940968352b1b7ed305bc5e3544581c6d3de4531 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<bool>.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 faeb14af41d1eabfd4047eb1c06d16aa102f943d..7cf4a3c5c6592009e8a14e31ea2e4c9e1d4b2862 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<bool>.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 2d8fba9c3ddbc3a5b55674b66b982bce3dc30439..9d84922ffb747132019433b5507eab621941c554 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 12f1204de485ba911d8a8246349fa1f6c92bdb29..5e71855794af204f7b67992e0e7f79586184f6d8 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 acf67c75cf7170e82c67fedeb0364bbea62989df..4c88d39840ebc034b1e18604d197190d1e7c2845 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 6f2d4967b2fe0cd67d85acac310417d32191f6a0..03c2bf89bb57d4257dd794bb8a5331d1dbfd8bd8 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 7453e03e0f81b1a6ca6df44a8048559db57f0a5d..42bd197d0610adf4e33cd115fc9ad3ebd0d796e3 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 3b481a4c78173f2a47a1ac1ab3b9f863d678dc68..5b5d7d47f880621012e1443236e526ba379b5ea9 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 a495fe87fc2b49508667fa8600334bf79c08bff0..86a9e9fc4a410844cc1ae51aa695ed120dc9e65c 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 c76ec4df0d303c34963ee20606ba6dce4cb8d3ff..832019afe0d76801e677e79de05af5ec19daf2cb 100644 --- a/lib/screens/onBoarding/6.dart +++ b/lib/screens/onBoarding/6.dart @@ -36,6 +36,7 @@ class OnboardingStepSix extends StatelessWidget { return Future<bool>.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 1c0c96c2c3af3f604deb49c377571d927da4215e..b430bf0fda3c3704e8df39f85dff03013b404a68 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 22b9fc2a3b00bfe98ab1c7e92f96372375d1197c..4bcb7444a632a4d01f597eaf460da09d5316dba5 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 b41dc2fb1013b8d847eec582fa9135a2afa0d079..5dda8788e49c9e622232e4a14ed58d64c19ed45a 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 0538a1c4fcc99e051ff281e6e09494eef174275a..7d23b305b34606cc0d3aa2c94d0a2e2ade3174e7 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<SearchProvider>(context); final double screenHeight = MediaQuery.of(context).size.height; + // HomeProvider _homeProvider = + // Provider.of<HomeProvider>(context, listen: false); return WillPopScope( onWillPop: () { @@ -22,6 +25,8 @@ class SearchScreen extends StatelessWidget { return Future<bool>.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: <Widget>[ SizedBox(height: isTall ? 200 : 100), diff --git a/lib/screens/search_result.dart b/lib/screens/search_result.dart index e837167c273e8f40438bb7cbd30cc2f9335c6065..3f34899903532dbafc02e61c2ba55ddf5203f7de 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 beab345c6f157e8991c07228a1fb84c866524bee..d58fbda97c4d45cb2b84bccbfe80985f9802afbb 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 faa92eceefd042ff637c60e119f2ccae57e04785..84bc7114a1ca72fe6569217b7ed519a4b546dde1 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<HomeProvider>(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: <Widget>[ - 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 <Widget>[ + 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 8cb179eab793f78286f6b5a9582567d6a555462a..07ac2e364ea3a2598f07ec95c24922c9585af8d5 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<bool>.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 6c8f805aec5f2ee39316a58948aea89ecf35e79a..308e6b09762331c0e9cf4d3026220ee50d63e947 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,