diff --git a/assets/cesium_bw2.svg b/assets/cesium_bw2.svg new file mode 100644 index 0000000..b7ef7a2 --- /dev/null +++ b/assets/cesium_bw2.svg @@ -0,0 +1,430 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/cesium_small.svg b/assets/cesium_small.svg new file mode 100644 index 0000000..0e61007 --- /dev/null +++ b/assets/cesium_small.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/onBoarding/cesium.png b/assets/onBoarding/cesium.png new file mode 100755 index 0000000..56a8b89 Binary files /dev/null and b/assets/onBoarding/cesium.png differ diff --git a/assets/onBoarding/chopp-gecko.png b/assets/onBoarding/chopp-gecko.png new file mode 100755 index 0000000..5023a03 Binary files /dev/null and b/assets/onBoarding/chopp-gecko.png differ diff --git a/assets/onBoarding/gecko-clin.gif b/assets/onBoarding/gecko-clin.gif new file mode 100644 index 0000000..43939dc Binary files /dev/null and b/assets/onBoarding/gecko-clin.gif differ diff --git a/assets/onBoarding/gecko_bar.png b/assets/onBoarding/gecko_bar.png new file mode 100755 index 0000000..3133f9f Binary files /dev/null and b/assets/onBoarding/gecko_bar.png differ diff --git a/assets/onBoarding/good-bad-passphrase.png b/assets/onBoarding/good-bad-passphrase.png new file mode 100755 index 0000000..edbda62 Binary files /dev/null and b/assets/onBoarding/good-bad-passphrase.png differ diff --git a/assets/onBoarding/keys-and-wallets-horizontal-plus-phrase.png b/assets/onBoarding/keys-and-wallets-horizontal-plus-phrase.png new file mode 100755 index 0000000..eea3e82 Binary files /dev/null and b/assets/onBoarding/keys-and-wallets-horizontal-plus-phrase.png differ diff --git a/assets/onBoarding/keys-and-wallets-horizontal.png b/assets/onBoarding/keys-and-wallets-horizontal.png new file mode 100755 index 0000000..e94e57d Binary files /dev/null and b/assets/onBoarding/keys-and-wallets-horizontal.png differ diff --git a/assets/onBoarding/keys.png b/assets/onBoarding/keys.png new file mode 100755 index 0000000..36362a0 Binary files /dev/null and b/assets/onBoarding/keys.png differ diff --git a/assets/onBoarding/maison-qui-brule.png b/assets/onBoarding/maison-qui-brule.png new file mode 100755 index 0000000..4e6b9ed Binary files /dev/null and b/assets/onBoarding/maison-qui-brule.png differ diff --git a/assets/onBoarding/phrase_de_restauration_flou.png b/assets/onBoarding/phrase_de_restauration_flou.png new file mode 100755 index 0000000..bc69307 Binary files /dev/null and b/assets/onBoarding/phrase_de_restauration_flou.png differ diff --git a/assets/onBoarding/phrase_flou.png b/assets/onBoarding/phrase_flou.png new file mode 100755 index 0000000..ebf7b89 Binary files /dev/null and b/assets/onBoarding/phrase_flou.png differ diff --git a/assets/onBoarding/plusieurs-appareils-un-trousseau.png b/assets/onBoarding/plusieurs-appareils-un-trousseau.png new file mode 100755 index 0000000..be1de87 Binary files /dev/null and b/assets/onBoarding/plusieurs-appareils-un-trousseau.png differ diff --git a/assets/onBoarding/plusieurs-codes-secrets-un-trousseau.png b/assets/onBoarding/plusieurs-codes-secrets-un-trousseau.png new file mode 100755 index 0000000..363595d Binary files /dev/null and b/assets/onBoarding/plusieurs-codes-secrets-un-trousseau.png differ diff --git a/assets/onBoarding/progress_bar/1.png b/assets/onBoarding/progress_bar/1.png new file mode 100755 index 0000000..9b9d514 Binary files /dev/null and b/assets/onBoarding/progress_bar/1.png differ diff --git a/assets/onBoarding/progress_bar/10.png b/assets/onBoarding/progress_bar/10.png new file mode 100755 index 0000000..3ff7080 Binary files /dev/null and b/assets/onBoarding/progress_bar/10.png differ diff --git a/assets/onBoarding/progress_bar/11.png b/assets/onBoarding/progress_bar/11.png new file mode 100755 index 0000000..961f4c3 Binary files /dev/null and b/assets/onBoarding/progress_bar/11.png differ diff --git a/assets/onBoarding/progress_bar/12.png b/assets/onBoarding/progress_bar/12.png new file mode 100755 index 0000000..bd4e93b Binary files /dev/null and b/assets/onBoarding/progress_bar/12.png differ diff --git a/assets/onBoarding/progress_bar/2.png b/assets/onBoarding/progress_bar/2.png new file mode 100755 index 0000000..3407586 Binary files /dev/null and b/assets/onBoarding/progress_bar/2.png differ diff --git a/assets/onBoarding/progress_bar/3.png b/assets/onBoarding/progress_bar/3.png new file mode 100755 index 0000000..3c9ec15 Binary files /dev/null and b/assets/onBoarding/progress_bar/3.png differ diff --git a/assets/onBoarding/progress_bar/4.png b/assets/onBoarding/progress_bar/4.png new file mode 100755 index 0000000..d61c442 Binary files /dev/null and b/assets/onBoarding/progress_bar/4.png differ diff --git a/assets/onBoarding/progress_bar/5.png b/assets/onBoarding/progress_bar/5.png new file mode 100755 index 0000000..420e546 Binary files /dev/null and b/assets/onBoarding/progress_bar/5.png differ diff --git a/assets/onBoarding/progress_bar/6.png b/assets/onBoarding/progress_bar/6.png new file mode 100755 index 0000000..b1bf527 Binary files /dev/null and b/assets/onBoarding/progress_bar/6.png differ diff --git a/assets/onBoarding/progress_bar/7.png b/assets/onBoarding/progress_bar/7.png new file mode 100755 index 0000000..72dc7b1 Binary files /dev/null and b/assets/onBoarding/progress_bar/7.png differ diff --git a/assets/onBoarding/progress_bar/8.png b/assets/onBoarding/progress_bar/8.png new file mode 100755 index 0000000..fb40c23 Binary files /dev/null and b/assets/onBoarding/progress_bar/8.png differ diff --git a/assets/onBoarding/progress_bar/9.png b/assets/onBoarding/progress_bar/9.png new file mode 100755 index 0000000..adfdbdb Binary files /dev/null and b/assets/onBoarding/progress_bar/9.png differ diff --git a/assets/onBoarding/progress_bar/total.png b/assets/onBoarding/progress_bar/total.png new file mode 100755 index 0000000..3fb1b08 Binary files /dev/null and b/assets/onBoarding/progress_bar/total.png differ diff --git a/assets/onBoarding/treasure-chest-gecko-souligne.png b/assets/onBoarding/treasure-chest-gecko-souligne.png new file mode 100755 index 0000000..50ac1fb Binary files /dev/null and b/assets/onBoarding/treasure-chest-gecko-souligne.png differ diff --git a/assets/onBoarding/wallet.png b/assets/onBoarding/wallet.png new file mode 100755 index 0000000..eb054f2 Binary files /dev/null and b/assets/onBoarding/wallet.png differ diff --git a/assets/printer.png b/assets/printer.png new file mode 100755 index 0000000..ced5f5d Binary files /dev/null and b/assets/printer.png differ diff --git a/lib/globals.dart b/lib/globals.dart index a248f6c..78a6a02 100644 --- a/lib/globals.dart +++ b/lib/globals.dart @@ -7,3 +7,7 @@ String appVersion; SharedPreferences prefs; String endPointGVA; int ramSys; + +// Responsive ratios +bool isTall; +double ratio; diff --git a/lib/main.dart b/lib/main.dart index 0b3fdc6..0bc8c08 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; import 'package:gecko/models/cesiumPlus.dart'; import 'package:gecko/models/changePin.dart'; @@ -10,9 +11,11 @@ import 'package:gecko/models/walletOptions.dart'; import 'package:gecko/screens/home.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:gecko/screens/myWallets/walletsHome.dart'; import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:provider/provider.dart'; import 'package:flutter/foundation.dart'; +import 'package:responsive_framework/responsive_framework.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:catcher/catcher.dart'; @@ -75,6 +78,7 @@ class Gecko extends StatelessWidget { @override Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); final _httpLink = HttpLink( randomEndpoint, ); @@ -100,21 +104,37 @@ class Gecko extends StatelessWidget { ChangeNotifierProvider(create: (_) => CesiumPlusProvider()) ], child: GraphQLProvider( - client: _client, - child: MaterialApp( - navigatorKey: Catcher.navigatorKey, - title: 'Ğecko', - theme: ThemeData( - primaryColor: Color(0xffFFD58D), - accentColor: Colors.grey[850], - textTheme: TextTheme( - bodyText1: TextStyle(), - bodyText2: TextStyle(), - ).apply( - bodyColor: Color(0xff855F2D), - ), + client: _client, + child: MaterialApp( + builder: (context, widget) => ResponsiveWrapper.builder( + BouncingScrollWrapper.builder(context, widget), + maxWidth: 1200, + minWidth: 480, + defaultScale: true, + breakpoints: [ + ResponsiveBreakpoint.resize(480, name: MOBILE), + ResponsiveBreakpoint.autoScale(800, name: TABLET), + ResponsiveBreakpoint.resize(1000, name: DESKTOP), + ], + background: Container(color: Color(0xFFF5F5F5))), + navigatorKey: Catcher.navigatorKey, + title: 'Ğecko', + theme: ThemeData( + primaryColor: Color(0xffFFD58D), + accentColor: Colors.grey[850], + textTheme: TextTheme( + bodyText1: TextStyle(), + bodyText2: TextStyle(), + ).apply( + bodyColor: Color(0xff855F2D), ), - home: HomeScreen(), - ))); + ), + home: HomeScreen(), + initialRoute: "/", + routes: { + '/mywallets': (context) => WalletsHome(), + }, + ), + )); } } diff --git a/lib/models/generateWallets.dart b/lib/models/generateWallets.dart index c7b7281..6629b21 100644 --- a/lib/models/generateWallets.dart +++ b/lib/models/generateWallets.dart @@ -22,6 +22,7 @@ class GenerateWalletsProvider with ChangeNotifier { bool isAskedWordValid = false; int nbrWord; + String nbrWordAlpha; String generatedMnemonic; bool walletIsGenerated = true; @@ -46,6 +47,7 @@ class GenerateWalletsProvider with ChangeNotifier { } else { nbrWallet = 1; } + Directory walletNbrDirectory; do { nbrWallet++; @@ -69,7 +71,9 @@ class GenerateWalletsProvider with ChangeNotifier { await configFile .writeAsString('$nbrWallet:$_name:$_derivationNbr:$_pubkey'); - Navigator.pop(context, true); + print('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); + print('${wallet.pin} : $_name : $isHD'); + // Navigator.pop(context, true); } else { final int _derivationNbr = -1; String _pubkey = await DubpRust.getDewifPublicKey( @@ -80,10 +84,7 @@ class GenerateWalletsProvider with ChangeNotifier { .writeAsString('$nbrWallet:$_name:$_derivationNbr:$_pubkey'); } - print('CODE PIN :::'); - print(wallet.pin); - - Navigator.pop(context, true); + // Navigator.pop(context, true); return _name; } @@ -113,7 +114,7 @@ class GenerateWalletsProvider with ChangeNotifier { print('Word is OK'); isAskedWordValid = true; askedWordColor = Colors.green[600]; - walletNameFocus.nextFocus(); + // walletNameFocus.nextFocus(); notifyListeners(); } else { isAskedWordValid = false; @@ -139,6 +140,26 @@ class GenerateWalletsProvider with ChangeNotifier { return rng.nextInt(12); } + String intToString(int _nbr) { + Map nbrToString = {}; + nbrToString[1] = 'Premier'; + nbrToString[2] = 'Deuxième'; + nbrToString[3] = 'Troisième'; + nbrToString[4] = 'Quatrième'; + nbrToString[5] = 'Cinquième'; + nbrToString[6] = 'Sixième'; + nbrToString[7] = 'Septième'; + nbrToString[8] = 'Huitième'; + nbrToString[9] = 'Neuvième'; + nbrToString[10] = 'Dixième'; + nbrToString[11] = 'Onzième'; + nbrToString[12] = 'Douzième'; + + nbrWordAlpha = nbrToString[_nbr]; + + return nbrWordAlpha; + } + void nameChanged() { notifyListeners(); } @@ -174,7 +195,7 @@ class GenerateWalletsProvider with ChangeNotifier { return this.actualWallet; } - Future changePinCode({bool reload}) async { + Future changePinCode({bool reload}) async { actualWallet = await DubpRust.changeDewifPin( dewif: actualWallet.dewif, oldPin: actualWallet.pin, @@ -185,6 +206,7 @@ class GenerateWalletsProvider with ChangeNotifier { if (reload) { notifyListeners(); } + return actualWallet; } Future printWallet(String _title) async { @@ -279,6 +301,22 @@ class GenerateWalletsProvider with ChangeNotifier { notifyListeners(); } + Future> generateWordList() async { + final String _sentance = await generateMnemonic(); + List _wordsList = []; + String word; + int _nbr = 1; + + for (word in _sentance.split(' ')) { + // print(word); + _wordsList.add("$_nbr:$word"); + _nbr++; + } + // notifyListeners(); + + return _wordsList; + } + // void makeError() { // var tata = File(appPath.path + '/ddfhjftjfg'); // tata.readAsLinesSync(); diff --git a/lib/models/walletOptions.dart b/lib/models/walletOptions.dart index 0b708c0..5b0ac9d 100644 --- a/lib/models/walletOptions.dart +++ b/lib/models/walletOptions.dart @@ -6,8 +6,8 @@ import 'dart:async'; import 'package:gecko/globals.dart'; class WalletOptionsProvider with ChangeNotifier { - TextEditingController pubkey = new TextEditingController(); - TextEditingController _newWalletName = new TextEditingController(); + TextEditingController pubkey = TextEditingController(); + TextEditingController _newWalletName = TextEditingController(); bool isWalletUnlock = false; bool ischangedPin = false; TextEditingController newPin = new TextEditingController(); @@ -61,8 +61,8 @@ class WalletOptionsProvider with ChangeNotifier { } } - Future readLocalWallet(int _walletNbr, String _name, String _pin, - int _pinLenght, int derivation) async { + Future readLocalWallet( + int _walletNbr, String _pin, int _pinLenght, int derivation) async { isWalletUnlock = false; try { File _walletFile = @@ -75,7 +75,7 @@ class WalletOptionsProvider with ChangeNotifier { 'false') { this.pubkey.text = _localPubkey; isWalletUnlock = true; - notifyListeners(); + // notifyListeners(); return _localDewif; } else { @@ -84,14 +84,35 @@ class WalletOptionsProvider with ChangeNotifier { } catch (e) { print('ERROR READING FILE: $e'); this.pubkey.clear(); + // notifyListeners(); return 'bad'; } } + Future checkPinOK(String _createdDewif, String _pin, int _pinLenght) async { + isWalletUnlock = false; + try { + if (await _getPubkeyFromDewif(_createdDewif, _pin, _pinLenght, 3) != + 'false') { + return true; + } else { + throw false; + } + } catch (e) { + print('ERROR READING FILE: $e'); + return false; + } + } + int getPinLenght(_walletNbr) { - File _walletFile = - File('${walletsDirectory.path}/$_walletNbr/wallet.dewif'); - String _localDewif = _walletFile.readAsStringSync(); + String _localDewif; + if (_walletNbr is int) { + File _walletFile = + File('${walletsDirectory.path}/$_walletNbr/wallet.dewif'); + _localDewif = _walletFile.readAsStringSync(); + } else { + _localDewif = _walletNbr; + } final int _pinLenght = DubpRust.getDewifSecretCodeLen( dewif: _localDewif, secretCodeType: SecretCodeType.letters); @@ -186,7 +207,10 @@ class WalletOptionsProvider with ChangeNotifier { final _walletFile = Directory('${walletsDirectory.path}/$_walletNbr'); await _walletFile.delete(recursive: true); } - Navigator.pop(context); + Navigator.popUntil( + context, + ModalRoute.withName('/mywallets'), + ); } return 0; } @@ -264,4 +288,8 @@ class WalletOptionsProvider with ChangeNotifier { duration: Duration(seconds: 2)); Scaffold.of(context).showSnackBar(snackBar); } + + void reloadBuild() { + notifyListeners(); + } } diff --git a/lib/screens/commonElements.dart b/lib/screens/commonElements.dart new file mode 100644 index 0000000..59bc2b6 --- /dev/null +++ b/lib/screens/commonElements.dart @@ -0,0 +1,227 @@ +import 'package:flutter/material.dart'; +import 'package:bubble/bubble.dart'; + +class CommonElements { + // Exemple de Widget + Widget exemple(String data) { + return Text('Coucou'); + } + + Widget bubbleSpeak(String text, {double long}) { + return Bubble( + padding: long == null + ? BubbleEdges.all(18) + : BubbleEdges.symmetric(horizontal: long, vertical: 30), + elevation: 5, + color: Colors.white, + margin: BubbleEdges.fromLTRB(10, 0, 20, 10), + // nip: BubbleNip.leftTop, + child: Text( + text, + style: TextStyle( + color: Colors.black, fontSize: 18, fontWeight: FontWeight.w400), + ), + ); + } + + Widget bubbleSpeakRich(List text) { + return Bubble( + padding: BubbleEdges.all(18), + elevation: 5, + color: Colors.white, + margin: BubbleEdges.fromLTRB(10, 0, 20, 10), + // nip: BubbleNip.leftTop, + child: RichText( + text: TextSpan( + style: TextStyle( + fontSize: 18.0, + color: Colors.black, + ), + children: text, + )), + ); + } + + Widget onboardingProgressBar( + BuildContext context, String screenTitle, int progress) { + return Stack(children: [ + Container(height: 100), + Positioned( + top: 0, left: 0, right: 0, child: GeckoSpeechAppBar(screenTitle)), + Positioned( + top: 0, + left: 0, + child: GestureDetector( + onTap: () { + Navigator.popUntil( + context, + ModalRoute.withName('/'), + ); + }, + child: Image.asset( + 'assets/onBoarding/gecko_bar.png', + ), + ), + ), + if (progress != 0) + Positioned( + top: 75, + left: 90, + child: Image.asset( + 'assets/onBoarding/progress_bar/total.png', + ), + ), + if (progress != 0) + Positioned( + top: 75, + left: 90, + child: Image.asset( + 'assets/onBoarding/progress_bar/$progress.png', + ), + ), + if (progress != 0) + Positioned( + top: 70, + right: 90, + child: Text(progress == 12 ? '11/11' : '$progress/11', + style: TextStyle(fontSize: 12, color: Colors.black)), + ), + ]); + } + + Widget roundButton( + AssetImage image, + ontap, + isAsync, + double imgHight, + EdgeInsets padding, + ) { + return Container( + child: ClipOval( + child: Material( + color: Color(0xffFFD58D), // button color + child: InkWell( + splashColor: Color(0xffD28928), // inkwell color + child: Padding( + padding: padding, + child: Image(image: image, height: imgHight)), + onTap: () async { + await ontap; + }), + ), + ), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.grey, + blurRadius: 4.0, + offset: Offset(2.0, 2.5), + spreadRadius: 0.5) + ], + ), + ); + } +} + +class SmoothTransition extends PageRouteBuilder { + final Widget page; + SmoothTransition({this.page}) + : super( + pageBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) => + TweenAnimationBuilder( + duration: const Duration(seconds: 5), + tween: Tween(begin: 200, end: 200), + builder: (BuildContext context, dynamic value, Widget child) { + return page; + }, + ), + ); +} + +class FaderTransition extends PageRouteBuilder { + final Widget page; + final bool isFast; + + FaderTransition({@required this.page, @required this.isFast}) + : super( + pageBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) => + page, + transitionsBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child, + ) => + FadeTransition( + opacity: + Tween(begin: 0.0, end: isFast ? 3.0 : 1.0).animate(animation), + child: child, + ), + ); +} + +class SlideLeftRoute extends PageRouteBuilder { + final Widget page; + SlideLeftRoute({this.page}) + : super( + pageBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) => + page, + transitionsBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child, + ) => + SlideTransition( + position: Tween( + begin: const Offset(1, 0), + end: Offset.zero, + ).animate(animation), + child: child, + ), + ); +} + +class GeckoSpeechAppBar extends StatelessWidget with PreferredSizeWidget { + @override + final Size preferredSize; + final String title; + + GeckoSpeechAppBar( + this.title, { + Key key, + }) : preferredSize = Size.fromHeight(105.4), + super(key: key); + + @override + Widget build(BuildContext context) { + return AppBar( + leading: IconButton( + icon: Container( + height: 30, + child: Image.asset('assets/onBoarding/gecko_bar.png')), + onPressed: () => Navigator.popUntil( + context, + ModalRoute.withName('/'), + ), + ), + title: SizedBox( + height: 25, + child: Text(title), + )); + } +} diff --git a/lib/screens/history.dart b/lib/screens/history.dart index e9ec8cb..5e8636a 100644 --- a/lib/screens/history.dart +++ b/lib/screens/history.dart @@ -28,6 +28,7 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier { @override Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); HistoryProvider _historyProvider = Provider.of(context); HomeProvider _homeProvider = Provider.of(context); this._outputPubkey.text = _historyProvider.pubkey; diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 54afc88..b16b8ac 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -3,17 +3,31 @@ import 'package:gecko/globals.dart'; import 'package:gecko/models/history.dart'; import 'package:gecko/models/home.dart'; import 'package:flutter/material.dart'; -import 'package:gecko/screens/myWallets/walletsHome.dart'; +import 'package:gecko/models/myWallets.dart'; +import 'package:gecko/screens/onBoarding/0_noKeychainFound.dart'; import 'dart:ui'; import 'package:gecko/screens/settings.dart'; +import 'package:flutter/services.dart'; import 'package:provider/provider.dart'; class HomeScreen extends StatelessWidget { @override Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); HomeProvider _homeProvider = Provider.of(context); HistoryProvider _historyProvider = Provider.of(context); HistoryProvider _historyStatic = HistoryProvider(''); + MyWalletsProvider _myWalletProvider = + Provider.of(context); + final bool isWalletsExists = _myWalletProvider.checkIfWalletExist(); + + isTall = false; + ratio = 1; + if (MediaQuery.of(context).size.height >= 930) { + isTall = true; + ratio = 1.125; + } + // CommonElements commonElements = CommonElements(); return Scaffold( resizeToAvoidBottomInset: false, drawer: Drawer( @@ -118,7 +132,7 @@ class HomeScreen extends StatelessWidget { }, child: Column(children: [ Padding( - padding: EdgeInsets.only(top: 22), + padding: EdgeInsets.only(top: 20), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -126,22 +140,24 @@ class HomeScreen extends StatelessWidget { Image( image: AssetImage('assets/icon/gecko_final.png'), - height: 160), + height: 180), ])), Padding( - padding: EdgeInsets.only(top: 12), + padding: EdgeInsets.only(top: 15), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - "L’application de paiement Ğ1\nplus mobile qu’un lésard du Vietnam", + "y'a pas de lézard !", textAlign: TextAlign.center, style: TextStyle( - color: Colors.black, fontSize: 15), + color: Colors.black, + fontSize: 17, + fontStyle: FontStyle.italic), ) ])), Padding( - padding: EdgeInsets.only(top: 40), + padding: EdgeInsets.only(top: 60), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -154,11 +170,11 @@ class HomeScreen extends StatelessWidget { splashColor: Color( 0xffD28928), // inkwell color child: Padding( - padding: EdgeInsets.all(17), + padding: EdgeInsets.all(22), child: Image( image: AssetImage( 'assets/qrcode-scan.png'), - height: 50)), + height: 60)), onTap: () async { await _historyProvider .scan(context); @@ -177,17 +193,17 @@ class HomeScreen extends StatelessWidget { ], ), ), - SizedBox(height: 10), + SizedBox(height: 12), Text( "Payer par QR-Code", textAlign: TextAlign.center, style: TextStyle( - color: Colors.black, fontSize: 13), + color: Colors.black, fontSize: 16), ) ]) ])), Padding( - padding: EdgeInsets.only(top: 40), + padding: EdgeInsets.only(top: 50), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -201,57 +217,19 @@ class HomeScreen extends StatelessWidget { 0xffD28928), // inkwell color child: Padding( padding: EdgeInsets.symmetric( - horizontal: 18, vertical: 14), + horizontal: 20, vertical: 16), child: Image( image: AssetImage( 'assets/blockchain.png'), - height: 55)), - onTap: () {}), - ), - ), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.grey, - blurRadius: 4.0, - offset: Offset(2.0, 2.5), - spreadRadius: 0.5) - ], - ), - ), - SizedBox(height: 10), - Text( - "Explorer\n", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.black, fontSize: 13), - ) - ]), - SizedBox(width: 100), - Column(children: [ - Container( - child: ClipOval( - child: Material( - color: Color(0xffFFD58D), // button color - child: InkWell( - splashColor: Color( - 0xffD28928), // inkwell color - child: Padding( - padding: EdgeInsets.all(20), - child: Image( - image: AssetImage( - 'assets/lock.png'), - height: 45)), + height: 70)), onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) { - return WalletsHome(); - }), - ); + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) { + // return TemplateScreen(); + // }), + // ); }), ), ), @@ -267,12 +245,59 @@ class HomeScreen extends StatelessWidget { ], ), ), - SizedBox(height: 10), + SizedBox(height: 12), + Text( + "Explorer\n", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, fontSize: 16), + ) + ]), + SizedBox(width: 140), + Column(children: [ + Container( + child: ClipOval( + child: Material( + color: Color(0xffFFD58D), // button color + child: InkWell( + splashColor: Color( + 0xffD28928), // inkwell color + child: Padding( + padding: EdgeInsets.all(23), + child: Image( + image: AssetImage( + 'assets/lock.png'), + height: 57)), + onTap: () { + isWalletsExists + ? Navigator.pushNamed( + context, '/mywallets') + : Navigator.push(context, + MaterialPageRoute( + builder: (context) { + return NoKeyChainScreen(); + })); + }), + ), + ), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.grey, + blurRadius: 4.0, + offset: Offset(2.0, 2.5), + spreadRadius: 0.5) + ], + ), + ), + SizedBox(height: 12), Text( "Gérer mes\nportefeuilles", textAlign: TextAlign.center, style: TextStyle( - color: Colors.black, fontSize: 13), + color: Colors.black, fontSize: 16), ) ]) ])) diff --git a/lib/screens/myWallets/changePin.dart b/lib/screens/myWallets/changePin.dart index 8141211..2242fe5 100644 --- a/lib/screens/myWallets/changePin.dart +++ b/lib/screens/myWallets/changePin.dart @@ -1,6 +1,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:dubp/dubp.dart'; +import 'package:flutter/services.dart'; import 'package:gecko/models/changePin.dart'; import 'dart:io'; import 'package:provider/provider.dart'; @@ -17,6 +18,7 @@ class ChangePinScreen extends StatelessWidget with ChangeNotifier { @override Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); ChangePinProvider _changePin = Provider.of(context); // _walletOptions.changePin(walletName, oldPin); // _walletOptions.newPin.text = _tmpPin; diff --git a/lib/screens/myWallets/confirmWalletStorage.dart b/lib/screens/myWallets/confirmWalletStorage.dart index 7bcc095..3b6385f 100644 --- a/lib/screens/myWallets/confirmWalletStorage.dart +++ b/lib/screens/myWallets/confirmWalletStorage.dart @@ -23,6 +23,7 @@ class ConfirmStoreWallet extends StatelessWidget with ChangeNotifier { @override Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); GenerateWalletsProvider _generateWalletProvider = Provider.of(context); MyWalletsProvider _myWalletProvider = diff --git a/lib/screens/myWallets/generateWallets.dart b/lib/screens/myWallets/generateWallets.dart index 9b2f9fb..8165ccf 100644 --- a/lib/screens/myWallets/generateWallets.dart +++ b/lib/screens/myWallets/generateWallets.dart @@ -1,3 +1,4 @@ +import 'package:flutter/services.dart'; import 'package:gecko/models/generateWallets.dart'; import 'package:gecko/screens/myWallets/confirmWalletStorage.dart'; import 'package:flutter/material.dart'; @@ -18,6 +19,7 @@ class GenerateWalletsScreen extends StatelessWidget { @override Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); GenerateWalletsProvider _generateWalletProvider = Provider.of(context); _generateWalletProvider.generateMnemonic(); diff --git a/lib/screens/myWallets/importWallet.dart b/lib/screens/myWallets/importWallet.dart index 5955469..ece2e5a 100644 --- a/lib/screens/myWallets/importWallet.dart +++ b/lib/screens/myWallets/importWallet.dart @@ -9,6 +9,7 @@ import 'package:provider/provider.dart'; class ImportWalletScreen extends StatelessWidget { @override Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); GlobalKey _toolTipSecret = GlobalKey(); Timer _debounce; GenerateWalletsProvider _generateWalletProvider = diff --git a/lib/screens/myWallets/unlockingWallet.dart b/lib/screens/myWallets/unlockingWallet.dart new file mode 100644 index 0000000..eb70588 --- /dev/null +++ b/lib/screens/myWallets/unlockingWallet.dart @@ -0,0 +1,164 @@ +import 'dart:async'; + +import 'package:dubp/dubp.dart'; +import 'package:flutter/services.dart'; +import 'package:gecko/models/walletOptions.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/screens/myWallets/walletOptions.dart'; +import 'package:pin_code_fields/pin_code_fields.dart'; +import 'package:provider/provider.dart'; +// import 'package:gecko/models/home.dart'; +// import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class UnlockingWallet extends StatelessWidget { + UnlockingWallet( + {Key keyUnlockWallet, + @required this.walletNbr, + @required this.walletName, + @required this.derivation}) + : super(key: keyUnlockWallet); + int walletNbr; + String walletName; + int derivation; + + // ignore: close_sinks + StreamController errorController; + final formKey = GlobalKey(); + bool hasError = false; + var pinColor = Color(0xffF9F9F1); + var walletPin = ''; + + Future get badWallet => null; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + WalletOptionsProvider _walletOptions = + Provider.of(context); + final int _pinLenght = _walletOptions.getPinLenght(this.walletNbr); + errorController = StreamController(); + + return Scaffold( + // backgroundColor: Colors.brown[600], + body: SafeArea( + child: Column(children: [ + SizedBox(height: 20), + Expanded( + child: Column(children: [ + SizedBox(height: 150), + Text( + 'Veuillez tapper votre code secret pour dévérouiller votre portefeuille.', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 15.0, + color: Colors.black, + fontWeight: FontWeight.w400), + ), + SizedBox(height: 50), + pinForm(context, _pinLenght, walletNbr, derivation), + ]), + ), + GestureDetector( + onTap: () { + Navigator.popUntil( + context, + ModalRoute.withName('/'), + ); + }, + child: Icon(Icons.home)) + ]), + )); + } + + Widget pinForm(context, _pinLenght, int _walletNbr, int _derivation) { + // var _walletPin = ''; +// ignore: close_sinks + StreamController errorController = + StreamController(); + TextEditingController _enterPin = TextEditingController(); + WalletOptionsProvider _walletOptions = + Provider.of(context); + + return Form( + key: formKey, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 30), + child: PinCodeTextField( + autoFocus: true, + appContext: context, + pastedTextStyle: TextStyle( + color: Colors.green.shade600, + fontWeight: FontWeight.bold, + ), + length: _pinLenght, + obscureText: false, + obscuringCharacter: '*', + animationType: AnimationType.fade, + validator: (v) { + if (v.length < _pinLenght) { + return "Votre code PIN fait $_pinLenght caractères"; + } else { + return null; + } + }, + pinTheme: PinTheme( + activeColor: pinColor, + borderWidth: 4, + shape: PinCodeFieldShape.box, + borderRadius: BorderRadius.circular(5), + fieldHeight: 60, + fieldWidth: 50, + activeFillColor: hasError ? Colors.blueAccent : Colors.black, + ), + cursorColor: Colors.black, + animationDuration: Duration(milliseconds: 300), + textStyle: TextStyle(fontSize: 20, height: 1.6), + backgroundColor: Color(0xffF9F9F1), + enableActiveFill: false, + errorAnimationController: errorController, + controller: _enterPin, + keyboardType: TextInputType.text, + boxShadows: [ + BoxShadow( + offset: Offset(0, 1), + color: Colors.black12, + blurRadius: 10, + ) + ], + onCompleted: (_pin) async { + print("Completed"); + final resultWallet = await _walletOptions.readLocalWallet( + this.walletNbr, + _pin.toUpperCase(), + _pinLenght, + this.derivation); + if (resultWallet == 'bad') { + errorController.add(ErrorAnimationType + .shake); // Triggering error shake animation + hasError = true; + pinColor = Colors.red[600]; + _walletOptions.reloadBuild(); + } else { + pinColor = Colors.green[400]; + // await Future.delayed(Duration(milliseconds: 50)); + Navigator.push( + context, + SmoothTransition( + page: WalletOptions( + walletNbr: walletNbr, + walletName: walletName, + derivation: derivation))); + } + }, + onChanged: (value) { + if (pinColor != Color(0xFFA4B600)) { + pinColor = Color(0xFFA4B600); + } + print(value); + }, + )), + ); + } +} diff --git a/lib/screens/myWallets/walletOptions.dart b/lib/screens/myWallets/walletOptions.dart index 0f21b6f..221e9e1 100644 --- a/lib/screens/myWallets/walletOptions.dart +++ b/lib/screens/myWallets/walletOptions.dart @@ -1,10 +1,8 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:dubp/dubp.dart'; import 'package:gecko/models/myWallets.dart'; import 'package:gecko/models/walletOptions.dart'; import 'dart:async'; -import 'package:pin_code_fields/pin_code_fields.dart'; import 'package:provider/provider.dart'; import 'package:flutter/services.dart'; @@ -20,245 +18,145 @@ class WalletOptions extends StatelessWidget with ChangeNotifier { String walletName; int derivation; - StreamController errorController; - TextEditingController _enterPin = TextEditingController(); - final formKey = GlobalKey(); - bool hasError = false; - var pinColor = Color(0xffF9F9F1); - var walletPin = ''; - - Future get badWallet => null; - @override Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); print("Build walletOptions"); WalletOptionsProvider _walletOptions = Provider.of(context); MyWalletsProvider _myWalletProvider = Provider.of(context); - errorController = StreamController(); - // _walletOptions.isWalletUnlock = false; - final int _pinLenght = _walletOptions.getPinLenght(this.walletNbr); + // _walletOptions.isWalletUnlock = false; + print("Is unlock ? ${_walletOptions.isWalletUnlock}"); return WillPopScope( onWillPop: () { _walletOptions.isWalletUnlock = false; + Navigator.popUntil( + context, + ModalRoute.withName('/mywallets'), + ); return Future.value(true); }, child: Scaffold( - resizeToAvoidBottomInset: false, - appBar: AppBar( - leading: IconButton( - icon: Icon(Icons.arrow_back, color: Colors.black), - onPressed: () { - _walletOptions.isWalletUnlock = false; - Navigator.of(context).pop(); - }), - title: SizedBox( - height: 22, - child: Text(walletName), - )), - body: Builder( - builder: (ctx) => SafeArea( - child: Column(children: [ - Visibility( - visible: _walletOptions.isWalletUnlock, - child: Expanded( - child: Column(children: [ - SizedBox(height: 15), - Text( - 'Clé publique:', + resizeToAvoidBottomInset: false, + appBar: AppBar( + leading: IconButton( + icon: Icon(Icons.arrow_back, color: Colors.black), + onPressed: () { + _walletOptions.isWalletUnlock = false; + Navigator.popUntil( + context, + ModalRoute.withName('/mywallets'), + ); + }), + title: SizedBox( + height: 22, + child: Text(walletName), + )), + body: Builder( + builder: (ctx) => SafeArea( + child: Column(children: [ + Expanded( + child: Column(children: [ + SizedBox(height: 15), + Text( + 'Clé publique:', + style: TextStyle( + fontSize: 15.0, + color: Colors.grey[600], + fontWeight: FontWeight.w400), + ), + SizedBox(height: 15), + GestureDetector( + onTap: () { + Clipboard.setData(ClipboardData( + text: _walletOptions.pubkey.text)); + _walletOptions.snackCopyKey(ctx); + }, + child: Text( + _walletOptions.pubkey.text, style: TextStyle( - fontSize: 15.0, - color: Colors.grey[600], - fontWeight: FontWeight.w400), - ), - SizedBox(height: 15), - GestureDetector( - onTap: () { - Clipboard.setData(ClipboardData( - text: _walletOptions.pubkey.text)); - _walletOptions.snackCopyKey(ctx); - }, - child: Text( - _walletOptions.pubkey.text, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: FontWeight.bold, - fontFamily: 'Monospace'), - )), - Expanded( - child: Align( - alignment: Alignment.bottomCenter, - child: SizedBox( - height: 50, - width: 300, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - elevation: 5, - primary: Color( - 0xffFFD68E), //Color(0xffFFD68E), // background - onPrimary: - Colors.black, // foreground - ), - onPressed: () => _walletOptions - .renameWalletAlerte( - context, - walletName, - walletNbr, - derivation) - .then((_result) { - if (_result == true) { - WidgetsBinding.instance - .addPostFrameCallback( - (_) { - _myWalletProvider - .listWallets = - _myWalletProvider - .getAllWalletsNames(); - _myWalletProvider - .rebuildWidget(); - }); - Navigator.pop( - context, true); - } - }), - child: Text( - 'Renommer ce portefeuille', - style: TextStyle( - fontSize: 20)))))), - SizedBox(height: 30), - SizedBox( - height: 50, - width: 300, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - elevation: 6, - primary: Colors - .redAccent, //Color(0xffFFD68E), // background - onPrimary: Colors.black, // foreground - ), - onPressed: () async { - await _walletOptions.deleteWallet(context, - walletNbr, walletName, derivation); - WidgetsBinding.instance - .addPostFrameCallback((_) { - _myWalletProvider.listWallets = - _myWalletProvider - .getAllWalletsNames(); - _myWalletProvider.rebuildWidget(); - }); - }, - child: Text('Supprimer ce portefeuille', - style: TextStyle(fontSize: 20)))), - SizedBox(height: 50), - Text( - 'Portefeuille déverrouillé', - style: TextStyle( - color: Colors.green, - fontWeight: FontWeight.w700, - fontSize: 15), - ), - SizedBox(height: 10) - ]))), - Visibility( - visible: !_walletOptions.isWalletUnlock, - child: Expanded( - child: Column(children: [ - SizedBox(height: 80), - Text( - 'Veuillez tapper votre code secret pour dévérouiller votre portefeuille.', - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 15.0, + fontSize: 14.0, color: Colors.black, - fontWeight: FontWeight.w400), - ), - SizedBox(height: 50), - Form( - key: formKey, - child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 8.0, horizontal: 30), - child: PinCodeTextField( - autoFocus: true, - appContext: context, - pastedTextStyle: TextStyle( - color: Colors.green.shade600, - fontWeight: FontWeight.bold, - ), - length: _pinLenght, - obscureText: false, - obscuringCharacter: '*', - animationType: AnimationType.fade, - validator: (v) { - if (v.length < _pinLenght) { - return "Votre code PIN fait $_pinLenght caractères"; - } else { - return null; - } - }, - pinTheme: PinTheme( - shape: PinCodeFieldShape.box, - borderRadius: BorderRadius.circular(5), - fieldHeight: 60, - fieldWidth: 50, - activeFillColor: hasError - ? Colors.orange - : Colors.white, - ), - cursorColor: Colors.black, - animationDuration: - Duration(milliseconds: 300), - textStyle: - TextStyle(fontSize: 20, height: 1.6), - backgroundColor: pinColor, - enableActiveFill: false, - errorAnimationController: errorController, - controller: _enterPin, - keyboardType: TextInputType.text, - boxShadows: [ - BoxShadow( - offset: Offset(0, 1), - color: Colors.black12, - blurRadius: 10, - ) - ], - onCompleted: (_pin) async { - print("Completed"); - final resultWallet = - await _walletOptions.readLocalWallet( - this.walletNbr, - this.walletName, - _pin.toUpperCase(), - _pinLenght, - this.derivation); - if (resultWallet == 'bad') { - errorController.add(ErrorAnimationType - .shake); // Triggering error shake animation - hasError = true; - pinColor = Colors.red[200]; - notifyListeners(); - } else { - pinColor = Colors.green[200]; - // setState(() {}); - // await Future.delayed(Duration(milliseconds: 50)); - this.walletPin = _pin.toUpperCase(); - // isWalletUnlock = true; - notifyListeners(); - } - }, - onChanged: (value) { - if (pinColor != Color(0xffF9F9F1)) { - pinColor = Color(0xffF9F9F1); - } - print(value); - }, - )), - ) - ]))), - ]))))); + fontWeight: FontWeight.bold, + fontFamily: 'Monospace'), + )), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + height: 50, + width: 300, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color( + 0xffFFD68E), //Color(0xffFFD68E), // background + onPrimary: Colors.black, // foreground + ), + onPressed: () => _walletOptions + .renameWalletAlerte( + context, + walletName, + walletNbr, + derivation) + .then((_result) { + if (_result == true) { + WidgetsBinding.instance + .addPostFrameCallback((_) { + _myWalletProvider + .listWallets = + _myWalletProvider + .getAllWalletsNames(); + _myWalletProvider + .rebuildWidget(); + }); + Navigator.popUntil( + context, + ModalRoute.withName( + '/mywallets'), + ); + } + }), + child: Text('Renommer ce portefeuille', + style: TextStyle(fontSize: 20)))))), + SizedBox(height: 30), + SizedBox( + height: 50, + width: 300, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 6, + primary: Colors + .redAccent, //Color(0xffFFD68E), // background + onPrimary: Colors.black, // foreground + ), + onPressed: () async { + await _walletOptions.deleteWallet(context, + walletNbr, walletName, derivation); + WidgetsBinding.instance + .addPostFrameCallback((_) { + _myWalletProvider.listWallets = + _myWalletProvider.getAllWalletsNames(); + _myWalletProvider.rebuildWidget(); + }); + }, + child: Text('Supprimer ce portefeuille', + style: TextStyle(fontSize: 20)))), + SizedBox(height: 50), + Text( + 'Portefeuille déverrouillé', + style: TextStyle( + color: Colors.green, + fontWeight: FontWeight.w700, + fontSize: 15), + ), + SizedBox(height: 10) + ])), + ]), + )), + )); } } diff --git a/lib/screens/myWallets/walletsHome.dart b/lib/screens/myWallets/walletsHome.dart index a9611a1..d7ddd84 100644 --- a/lib/screens/myWallets/walletsHome.dart +++ b/lib/screens/myWallets/walletsHome.dart @@ -1,9 +1,9 @@ +import 'package:flutter/services.dart'; import 'package:gecko/models/myWallets.dart'; import 'package:gecko/models/walletOptions.dart'; -import 'package:gecko/screens/myWallets/generateWallets.dart'; import 'package:flutter/material.dart'; -import 'package:gecko/screens/myWallets/importWallet.dart'; -import 'package:gecko/screens/myWallets/walletOptions.dart'; +import 'package:gecko/screens/myWallets/unlockingWallet.dart'; +import 'package:gecko/screens/onBoarding/0_noKeychainFound.dart'; import 'package:provider/provider.dart'; // ignore: must_be_immutable @@ -13,6 +13,7 @@ class WalletsHome extends StatelessWidget { @override Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); MyWalletsProvider myWalletProvider = Provider.of(context); WalletOptionsProvider _walletOptions = @@ -48,59 +49,15 @@ class WalletsHome extends StatelessWidget { }); }, child: Container( - height: 40.0, - width: 40.0, + height: 40, + width: 40, child: Icon(Icons.person_add_alt_1_rounded, color: Colors.grey[850])), backgroundColor: Color(0xffEFEFBF))))), body: SafeArea( - child: Column(children: [ - Visibility( - visible: (!isWalletsExists), - child: Column(children: [ - SizedBox(height: 120), - Center( - child: Text("Vous n'avez encore généré aucun portefeuille.", - style: TextStyle( - fontSize: 20, fontWeight: FontWeight.w500), - textAlign: TextAlign.center)), - SizedBox(height: 80), - ElevatedButton( - style: ElevatedButton.styleFrom( - primary: Color(0xffFFD68E), // background - onPrimary: Colors.black, // foreground - ), - onPressed: () => Navigator.push( - context, - MaterialPageRoute(builder: (context) { - return GenerateWalletsScreen(); - }), - ), - child: Text('Générer un trousseau', - style: TextStyle(fontSize: 20))), - SizedBox(height: 15), - Center( - child: Text("ou", - style: TextStyle( - fontSize: 20, fontWeight: FontWeight.w500), - textAlign: TextAlign.center)), - SizedBox(height: 15), - ElevatedButton( - style: ElevatedButton.styleFrom( - primary: Color(0xffFFD68E), // background - onPrimary: Colors.black, // foreground - ), - onPressed: () => Navigator.push( - context, - MaterialPageRoute(builder: (context) { - return ImportWalletScreen(); - }), - ), - child: Text('Importer un portefeuille existant', - style: TextStyle(fontSize: 20))), - ])), - Visibility(visible: isWalletsExists, child: myWalletsList(context)) - ]))); + child: !isWalletsExists + ? NoKeyChainScreen() + : myWalletsList(context))); } Widget myWalletsList(BuildContext context) { @@ -140,7 +97,7 @@ class WalletsHome extends StatelessWidget { dense: true, onTap: () { Navigator.push(context, MaterialPageRoute(builder: (context) { - return WalletOptions( + return UnlockingWallet( walletNbr: int.parse(_repository.split(':')[0]), walletName: _repository.split(':')[1], derivation: int.parse(_repository.split(':')[2])); diff --git a/lib/screens/onBoarding/0_noKeychainFound.dart b/lib/screens/onBoarding/0_noKeychainFound.dart new file mode 100644 index 0000000..d5c9acb --- /dev/null +++ b/lib/screens/onBoarding/0_noKeychainFound.dart @@ -0,0 +1,112 @@ +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/myWallets/importWallet.dart'; +import 'package:gecko/screens/onBoarding/1.dart'; +// import 'package:gecko/models/home.dart'; +// import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class NoKeyChainScreen extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + return Scaffold( + extendBodyBehindAppBar: true, + // backgroundColor: Colors.white, + // appBar: GeckoSpeechAppBar('Mes portefeuilles'), + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar(context, 'Mes portefeuilles', 0), + common.bubbleSpeak( + "Je ne connais pour l’instant aucun de vos portefeuilles.\n\nVous pouvez en créer un nouveau, ou bien importer un portefeuille Cesium existant.", + ), + SizedBox(height: 90), + Container( + child: ClipOval( + child: Material( + color: Color(0xffFFD58D), // button color + child: InkWell( + splashColor: Color(0xffD28928), // inkwell color + child: Padding( + padding: EdgeInsets.all(8), + child: Image( + image: AssetImage('assets/onBoarding/wallet.png'), + height: 90)), + onTap: () { + Navigator.push( + context, + FaderTransition( + page: OnboardingStepOne(), isFast: true)); + }), + ), + ), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.grey, + blurRadius: 4.0, + offset: Offset(2.0, 2.5), + spreadRadius: 0.5) + ], + ), + ), + SizedBox(height: 15), + Text( + "Créer un nouveau\nportefeuille", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontSize: 16, + fontWeight: FontWeight.w500), + ), + SizedBox(height: 70), + Container( + child: ClipOval( + child: Material( + color: Color(0xffFFD58D), // button color + child: InkWell( + splashColor: Color(0xffD28928), // inkwell color + child: Padding( + padding: EdgeInsets.all(12), + child: + // Image( + // image: AssetImage('assets/cesium_bw3.png'), + // height: 60), + SvgPicture.asset('assets/cesium_small.svg', + semanticsLabel: 'Cesium Logo', height: 48), + ), + onTap: () { + Navigator.push(context, + SlideLeftRoute(page: ImportWalletScreen())); + }), + ), + ), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.grey, + blurRadius: 4.0, + offset: Offset(2.0, 2.5), + spreadRadius: 0.5) + ], + ), + ), + SizedBox(height: 10), + Text( + "Importer un\nportefeuille Cesium", + textAlign: TextAlign.center, + style: TextStyle(color: Colors.black, fontSize: 13), + ) + ]), + )); + } +} diff --git a/lib/screens/onBoarding/1.dart b/lib/screens/onBoarding/1.dart new file mode 100644 index 0000000..8be6764 --- /dev/null +++ b/lib/screens/onBoarding/1.dart @@ -0,0 +1,57 @@ +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/2.dart'; +// import 'package:gecko/models/home.dart'; +// import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class OnboardingStepOne extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 1; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + + return Scaffold( + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar( + context, 'Nouveau portefeuilles', progress), + common.bubbleSpeak( + "Il semblerait que vous n’ayez pas encore de trousseau.\n\nUn trousseau vous permet de gérer un ou plusieurs portefeuilles.", + ), + SizedBox(height: 90), + Image.asset( + 'assets/onBoarding/keys-and-wallets-horizontal.png', + height: 200, + ), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + FaderTransition( + page: OnboardingStepTwo(), isFast: true)); + }, + child: Text('Créer mon trousseau', + style: TextStyle(fontSize: 20))), + ))), + SizedBox(height: 80), + ]), + )); + } +} diff --git a/lib/screens/onBoarding/10.dart b/lib/screens/onBoarding/10.dart new file mode 100644 index 0000000..a70f5e8 --- /dev/null +++ b/lib/screens/onBoarding/10.dart @@ -0,0 +1,56 @@ +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/globals.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/11.dart'; + +// ignore: must_be_immutable +class OnboardingStepTwelve extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 9; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + + return Scaffold( + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar( + context, 'Ma phrase de restauration', progress), + common.bubbleSpeak( + "Si un jour vous changez de téléphone, votre code secret sera différent, mais il vous suffira de me redonner votre phrase de restauration pour recréer votre trousseau."), + SizedBox(height: 10), + Image.asset( + 'assets/onBoarding/plusieurs-codes-secrets-un-trousseau.png', + height: 410 * ratio, + ), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + FaderTransition( + page: OnboardingStepThirteen(), isFast: true), + ); + }, + child: Text("Générer le code secret", + style: TextStyle(fontSize: 20))), + ))), + SizedBox(height: isTall ? 80 : 40), + ]), + )); + } +} diff --git a/lib/screens/onBoarding/11.dart b/lib/screens/onBoarding/11.dart new file mode 100644 index 0000000..b10fd02 --- /dev/null +++ b/lib/screens/onBoarding/11.dart @@ -0,0 +1,123 @@ +import 'dart:ui'; +import 'package:dubp/dubp.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/models/generateWallets.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/12.dart'; +import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class OnboardingStepThirteen extends StatelessWidget { + NewWallet generatedWallet; + final int progress = 10; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + GenerateWalletsProvider _generateWalletProvider = + Provider.of(context); + // MyWalletsProvider myWalletProvider = + // Provider.of(context); + CommonElements common = CommonElements(); + _generateWalletProvider.pin.text = ''; + + return Scaffold( + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + FutureBuilder( + future: _generateWalletProvider.changePinCode(reload: false), + // initialData: '...', + builder: (context, snapshot) { + generatedWallet = snapshot.data; + return Visibility(visible: false, child: Text('')); + }), + common.onboardingProgressBar( + context, 'Ma phrase de restauration', progress), + common.bubbleSpeakRich([ + TextSpan( + text: + "Et voilà votre code secret !\n\nMémorisez-le ou notez-le, car il vous sera demandé "), + TextSpan( + text: 'à chaque fois', + style: TextStyle(fontWeight: FontWeight.bold)), + TextSpan( + text: + " que vous voudrez effectuer un paiement sur cet appareil."), + ]), + SizedBox(height: 100), + Container( + child: Stack( + alignment: Alignment.centerRight, + children: [ + TextField( + enabled: false, + controller: _generateWalletProvider.pin, + maxLines: 1, + textAlign: TextAlign.center, + decoration: InputDecoration(), + style: TextStyle( + letterSpacing: 5, + fontSize: 35.0, + color: Colors.black, + fontWeight: FontWeight.bold)), + IconButton( + icon: Icon(Icons.replay), + color: Color(0xffD28928), + onPressed: () async { + generatedWallet = await _generateWalletProvider + .changePinCode(reload: false); + }, + ), + ], + ), + ), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffFFD58D), + onPrimary: Colors.black, // foreground + ), + onPressed: () async { + generatedWallet = await _generateWalletProvider + .changePinCode(reload: false); + }, + child: Text("Choisir un autre code secret", + style: TextStyle(fontSize: 20))), + ))), + SizedBox(height: 25), + SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () async { + _generateWalletProvider.isAskedWordValid = false; + _generateWalletProvider.askedWordColor = Colors.black; + Navigator.push( + context, + FaderTransition( + page: OnboardingStepFourteen( + generatedWallet: generatedWallet), + isFast: true), + ); + }, + child: Text("J'ai noté mon code secret", + style: TextStyle(fontSize: 20))), + ), + SizedBox(height: 80), + ]), + )); + } +} diff --git a/lib/screens/onBoarding/12.dart b/lib/screens/onBoarding/12.dart new file mode 100644 index 0000000..73f44ee --- /dev/null +++ b/lib/screens/onBoarding/12.dart @@ -0,0 +1,147 @@ +import 'dart:async'; +import 'dart:ui'; +import 'package:dubp/dubp.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/globals.dart'; +import 'package:gecko/models/generateWallets.dart'; +import 'package:gecko/models/myWallets.dart'; +import 'package:gecko/models/walletOptions.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/13_congratulations.dart'; +import 'package:pin_code_fields/pin_code_fields.dart'; +import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class OnboardingStepFourteen extends StatelessWidget { + OnboardingStepFourteen({ + Key validationKey, + @required this.generatedWallet, + }) : super(key: validationKey); + + NewWallet generatedWallet; + final int progress = 11; + final formKey = GlobalKey(); + var pinColor = Color(0xFFA4B600); + bool hasError = false; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + // GenerateWalletsProvider _generateWalletProvider = + // Provider.of(context); + WalletOptionsProvider _walletOptions = + Provider.of(context); + CommonElements common = CommonElements(); + final int _pinLenght = _walletOptions.getPinLenght(generatedWallet.dewif); + + return Scaffold( + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar( + context, 'Ma phrase de restauration', progress), + common.bubbleSpeak( + "Avez-vous bien mémorisé votre code secret ?\n\nVérifions ça ensemble !\n\nTapez votre code secret dans le champ ci-dessous (après c’est fini, promis-juré-gecko)."), + SizedBox(height: isTall ? 80 : 10), + pinForm(context, _walletOptions, _pinLenght, 1, 3) + ]), + )); + } + + Widget pinForm(context, WalletOptionsProvider _walletOptions, _pinLenght, + int _walletNbr, int _derivation) { + // var _walletPin = ''; +// ignore: close_sinks + StreamController errorController = + StreamController(); + TextEditingController _enterPin = TextEditingController(); + MyWalletsProvider _myWalletProvider = + Provider.of(context); + GenerateWalletsProvider _generateWalletProvider = + Provider.of(context); + + return Form( + key: formKey, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 30), + child: PinCodeTextField( + autoFocus: true, + appContext: context, + pastedTextStyle: TextStyle( + color: Colors.green.shade600, + fontWeight: FontWeight.bold, + ), + length: _pinLenght, + obscureText: false, + obscuringCharacter: '*', + animationType: AnimationType.fade, + validator: (v) { + if (v.length < _pinLenght) { + return "Votre code PIN fait $_pinLenght caractères"; + } else { + return null; + } + }, + pinTheme: PinTheme( + activeColor: pinColor, + borderWidth: 4, + shape: PinCodeFieldShape.box, + borderRadius: BorderRadius.circular(5), + fieldHeight: 60, + fieldWidth: 50, + activeFillColor: hasError ? Colors.blueAccent : Colors.black, + ), + cursorColor: Colors.black, + animationDuration: Duration(milliseconds: 300), + textStyle: TextStyle(fontSize: 20, height: 1.6), + backgroundColor: Color(0xffF9F9F1), + enableActiveFill: false, + errorAnimationController: errorController, + controller: _enterPin, + keyboardType: TextInputType.text, + boxShadows: [ + BoxShadow( + offset: Offset(0, 1), + color: Colors.black12, + blurRadius: 10, + ) + ], + onCompleted: (_pin) async { + print("Completed"); + // final resultWallet = await _walletOptions.readLocalWallet( + // _walletNbr, _pin.toUpperCase(), _pinLenght, _derivation); + final bool resultWallet = await _walletOptions.checkPinOK( + generatedWallet.dewif, _pin.toUpperCase(), _pinLenght); + if (resultWallet) { + pinColor = Colors.green[500]; + print(generatedWallet.pin); + await _generateWalletProvider.storeWallet( + generatedWallet, 'Mon portefeuille courant', context, + isHD: true); + _myWalletProvider.getAllWalletsNames(); + _walletOptions.reloadBuild(); + _myWalletProvider.rebuildWidget(); + Navigator.push( + context, + FaderTransition( + page: OnboardingStepFiveteen(), isFast: false), + ); + } else { + errorController.add(ErrorAnimationType + .shake); // Triggering error shake animation + hasError = true; + pinColor = Colors.red[600]; + _walletOptions.reloadBuild(); + } + }, + onChanged: (value) { + if (pinColor != Color(0xFFA4B600)) { + pinColor = Color(0xFFA4B600); + } + print(value); + }, + )), + ); + } +} diff --git a/lib/screens/onBoarding/13_congratulations.dart b/lib/screens/onBoarding/13_congratulations.dart new file mode 100644 index 0000000..d55b6f4 --- /dev/null +++ b/lib/screens/onBoarding/13_congratulations.dart @@ -0,0 +1,60 @@ +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/globals.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/myWallets/walletsHome.dart'; + +// ignore: must_be_immutable +class OnboardingStepFiveteen extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 12; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + + return Scaffold( + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar( + context, 'Ma phrase de restauration', progress), + common.bubbleSpeak( + "Top !\n\nVotre trousseau de clef et votre portefeuille ont été créés avec un immense succès.\n\nFélicitations !", + ), + SizedBox(height: isTall ? 20 : 10), + Image.asset( + 'assets/onBoarding/gecko-clin.gif', + height: isTall ? 400 : 300, + ), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.popUntil( + context, + ModalRoute.withName('/'), + ); + Navigator.push( + context, + SmoothTransition(page: WalletsHome()), + ); + }, + child: Text("Accéder à mes portefeuilles", + style: TextStyle(fontSize: 20))), + ))), + SizedBox(height: 80), + ]), + )); + } +} diff --git a/lib/screens/onBoarding/2.dart b/lib/screens/onBoarding/2.dart new file mode 100644 index 0000000..6cdfaf8 --- /dev/null +++ b/lib/screens/onBoarding/2.dart @@ -0,0 +1,57 @@ +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/3.dart'; +// import 'package:gecko/screens/commonElements.dart'; +// import 'package:gecko/models/home.dart'; +// import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class OnboardingStepTwo extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 2; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + + return Scaffold( + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar( + context, 'Nouveau portefeuilles', progress), + common.bubbleSpeak( + "Un trousseau est créé à partir d’une phrase de restauration.", + ), + SizedBox(height: 70), + Image.asset( + 'assets/onBoarding/keys-and-wallets-horizontal-plus-phrase.png'), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + FaderTransition( + page: OnboardingStepFor(), isFast: true), + ); + }, + child: Text("D'accord", style: TextStyle(fontSize: 20)), + ), + ))), + SizedBox(height: 80), + ]), + )); + } +} diff --git a/lib/screens/onBoarding/3.dart b/lib/screens/onBoarding/3.dart new file mode 100644 index 0000000..279568f --- /dev/null +++ b/lib/screens/onBoarding/3.dart @@ -0,0 +1,62 @@ +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/globals.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/4.dart'; + +// ignore: must_be_immutable +class OnboardingStepFor extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 3; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + + return Scaffold( + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar( + context, 'Ma phrase de restauration', progress), + common.bubbleSpeak( + "Si un jour vous changez de téléphone, il vous suffira de me redonner votre phrase de restauration pour recréer votre trousseau.", + ), + SizedBox(height: isTall ? 15 : 0), + // Row(children: [ + // Align( + // alignment: Alignment.centerRight, + // child: + Image.asset( + 'assets/onBoarding/plusieurs-appareils-un-trousseau.png', + height: 400 * ratio, + ), + // ]), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + FaderTransition( + page: OnboardingStepFive(), isFast: true), + ); + }, + child: Text("J'ai compris", + style: TextStyle(fontSize: 20))), + ))), + SizedBox(height: 80), + ]), + )); + } +} diff --git a/lib/screens/onBoarding/4.dart b/lib/screens/onBoarding/4.dart new file mode 100644 index 0000000..4f239df --- /dev/null +++ b/lib/screens/onBoarding/4.dart @@ -0,0 +1,57 @@ +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/globals.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/5.dart'; + +// ignore: must_be_immutable +class OnboardingStepFive extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 4; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + + return Scaffold( + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar( + context, 'Ma phrase de restauration', progress), + common.bubbleSpeak( + "Par contre, attention :\n\nDans une blockchain, il n’y a pas de procédure de récupération de trousseau.\n\nSi vous perdez votre phrase de restauration, je ne pourrai pas vous la communiquer, et vous ne pourrez donc plus jamais accéder à votre compte.", + ), + SizedBox(height: isTall ? 30 : 10), + Image.asset( + 'assets/onBoarding/maison-qui-brule.png', + width: 320 * ratio, + ), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + FaderTransition( + page: OnboardingStepSeven(), isFast: true), + ); + }, + child: Text("J'ai compris", + style: TextStyle(fontSize: 20))), + ))), + SizedBox(height: 80), + ]), + )); + } +} diff --git a/lib/screens/onBoarding/5.dart b/lib/screens/onBoarding/5.dart new file mode 100644 index 0000000..38eeece --- /dev/null +++ b/lib/screens/onBoarding/5.dart @@ -0,0 +1,74 @@ +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/globals.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/6.dart'; + +// ignore: must_be_immutable +class OnboardingStepSeven extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 5; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + + return Scaffold( + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar( + context, 'Ma phrase de restauration', progress), + common.bubbleSpeakRich( + [ + TextSpan(text: "Munissez-vous d'"), + TextSpan( + text: 'un papier et d’un crayon\n', + style: TextStyle(fontWeight: FontWeight.bold)), + TextSpan( + text: + "afin de pouvoir noter votre phrase de restauration."), + ], + ), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: Row(mainAxisSize: MainAxisSize.min, children: [ + Container( + padding: const EdgeInsets.only(bottom: 90), + child: common.bubbleSpeak( + "Moi, j’ai déjà essayé de\nmémoriser une phrase de\nrestauration, mais je n’ai\npas une mémoire\nd’éléphant.", + ), + ), + Image.asset( + 'assets/onBoarding/chopp-gecko.png', + height: 200, + ), + ]), + )), + SizedBox(height: isTall ? 120 : 50), + SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + FaderTransition( + page: OnboardingStepEight(), isFast: true), + ); + }, + child: Text("J'ai de quoi noter", + style: TextStyle(fontSize: 20))), + ), + SizedBox(height: 80), + ]), + )); + } +} diff --git a/lib/screens/onBoarding/6.dart b/lib/screens/onBoarding/6.dart new file mode 100644 index 0000000..2988d1a --- /dev/null +++ b/lib/screens/onBoarding/6.dart @@ -0,0 +1,117 @@ +import 'dart:ui'; +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/globals.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/7.dart'; + +// ignore: must_be_immutable +class OnboardingStepEight extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 6; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + + return Scaffold( + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar( + context, 'Ma phrase de restauration', progress), + common.bubbleSpeak( + "J’ai généré votre phrase de restauration !\nTâchez de la garder bien secrète, car elle permet à quiconque la connaît d’accéder à tous vos portefeuilles.", + ), + SizedBox(height: isTall ? 61 : 31), + // SizedBox(height: 30), + sentanceArray(context), + // ), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + FaderTransition( + page: OnboardingStepNine(), isFast: false), + ); + }, + child: Text("Afficher ma phrase", + style: TextStyle(fontSize: 20))), + ))), + SizedBox(height: 80), + ]), + )); + } +} + +Widget sentanceArray(BuildContext context) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 12), + child: Container( + decoration: BoxDecoration( + border: Border.all(color: Colors.black), + color: Colors.grey[300], + borderRadius: BorderRadius.all( + const Radius.circular(10), + )), + // color: Colors.grey[300], + padding: EdgeInsets.all(20), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row(children: [ + arrayCell("1:exquis"), + arrayCell("2:favori"), + arrayCell("3:curseur"), + arrayCell("4:relatif"), + ]), + SizedBox(height: 15), + Row(children: [ + arrayCell("5:embellir"), + arrayCell("6:cultiver"), + arrayCell("7:bureau"), + arrayCell("8:ossature"), + ]), + SizedBox(height: 15), + Row(children: [ + arrayCell("9:labial"), + arrayCell("10:science"), + arrayCell("11:théorie"), + arrayCell("12:Monnaie"), + ]), + ]))); +} + +Widget arrayCell(dataWord) { + return Container( + width: 102, + child: Column( + children: [ + ImageFiltered( + imageFilter: ImageFilter.blur(sigmaX: 1, sigmaY: 1), + child: Text(dataWord.split(':')[0], + style: TextStyle(fontSize: 14, color: Colors.black)), + ), + SizedBox(height: 2), + ImageFiltered( + imageFilter: ImageFilter.blur(sigmaX: 4, sigmaY: 4), + child: Text(dataWord.split(':')[1], + style: TextStyle(fontSize: 20, color: Colors.black)), + ) + ], + )); +} diff --git a/lib/screens/onBoarding/7.dart b/lib/screens/onBoarding/7.dart new file mode 100644 index 0000000..be08955 --- /dev/null +++ b/lib/screens/onBoarding/7.dart @@ -0,0 +1,197 @@ +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/globals.dart'; +import 'package:gecko/models/generateWallets.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/8.dart'; +import 'package:printing/printing.dart'; +import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class OnboardingStepNine extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 6; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + GenerateWalletsProvider _generateWalletProvider = + Provider.of(context); + CommonElements common = CommonElements(); + + // _generateWalletProvider.generateMnemonic(); + + return Scaffold( + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar( + context, 'Ma phrase de restauration', progress), + common.bubbleSpeak( + "C’est le moment de noter votre phrase !", + long: 60, + ), + SizedBox(height: isTall ? 100 : 70), + sentanceArray(context), + SizedBox(height: isTall ? 20 : 15), + GestureDetector( + onTap: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) { + return PrintWallet( + _generateWalletProvider.generatedMnemonic); + }), + ); + }, + child: Image.asset( + 'assets/printer.png', + ), + ), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffFFD58D), + onPrimary: Colors.black, // foreground + ), + onPressed: () { + _generateWalletProvider.reloadBuild(); + }, + child: Text("Choisir une autre phrase", + style: TextStyle(fontSize: 20))), + ))), + SizedBox(height: 25), + SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + _generateWalletProvider.nbrWord = + _generateWalletProvider.getRandomInt(); + _generateWalletProvider.nbrWordAlpha = + _generateWalletProvider + .intToString(_generateWalletProvider.nbrWord + 1); + + Navigator.push( + context, + FaderTransition( + page: OnboardingStepTen( + generatedMnemonic: + _generateWalletProvider.generatedMnemonic, + generatedWallet: + _generateWalletProvider.actualWallet), + isFast: true), + ); + }, + child: Text("J'ai noté ma phrase", + style: TextStyle(fontSize: 20))), + ), + SizedBox(height: 80), + ]), + )); + } +} + +Widget sentanceArray(BuildContext context) { + GenerateWalletsProvider _generateWalletProvider = + Provider.of(context); + + return FutureBuilder( + future: _generateWalletProvider.generateWordList(), + initialData: [ + '1:...', + '2:...', + '3:...', + '4:...', + '5:...', + '6:...', + '7:...', + '8:...', + '9:...', + '10:...', + '11:...', + '12:...', + ], + builder: (context, formatedArray) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 12), + child: Container( + decoration: BoxDecoration( + border: Border.all(color: Colors.black), + color: Colors.grey[300], + borderRadius: BorderRadius.all( + const Radius.circular(10), + )), + // color: Colors.grey[300], + padding: EdgeInsets.all(20), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row(children: [ + arrayCell(formatedArray.data[0]), + arrayCell(formatedArray.data[1]), + arrayCell(formatedArray.data[2]), + arrayCell(formatedArray.data[3]), + ]), + SizedBox(height: 15), + Row(children: [ + arrayCell(formatedArray.data[4]), + arrayCell(formatedArray.data[5]), + arrayCell(formatedArray.data[6]), + arrayCell(formatedArray.data[7]), + ]), + SizedBox(height: 15), + Row(children: [ + arrayCell(formatedArray.data[8]), + arrayCell(formatedArray.data[9]), + arrayCell(formatedArray.data[10]), + arrayCell(formatedArray.data[11]), + ]), + ]))); + }); +} + +Widget arrayCell(dataWord) { + return Container( + width: 102, + child: Column(children: [ + Text(dataWord.split(':')[0], style: TextStyle(fontSize: 14)), + SizedBox(height: 2), + Text(dataWord.split(':')[1], + style: TextStyle(fontSize: 19, color: Colors.black)), + ])); +} + +// ignore: must_be_immutable +class PrintWallet extends StatelessWidget { + PrintWallet(this.sentence); + + final String sentence; + + @override + Widget build(BuildContext context) { + GenerateWalletsProvider _generateWalletProvider = + Provider.of(context); + return MaterialApp( + home: Scaffold( + appBar: AppBar(title: Text('Imprimer ce trousseau')), + body: PdfPreview( + build: (format) => _generateWalletProvider.printWallet(sentence), + ), + ), + ); + } +} diff --git a/lib/screens/onBoarding/8.dart b/lib/screens/onBoarding/8.dart new file mode 100644 index 0000000..020e8c3 --- /dev/null +++ b/lib/screens/onBoarding/8.dart @@ -0,0 +1,177 @@ +import 'dart:ui'; +import 'package:dubp/dubp.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/globals.dart'; +import 'package:gecko/models/generateWallets.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/9.dart'; +import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class OnboardingStepTen extends StatelessWidget { + OnboardingStepTen({ + Key validationKey, + @required this.generatedMnemonic, + @required this.generatedWallet, + }) : super(key: validationKey); + + String generatedMnemonic; + NewWallet generatedWallet; + + TextEditingController tplController = TextEditingController(); + TextEditingController wordController = TextEditingController(); + TextEditingController _mnemonicController = TextEditingController(); + + final int progress = 7; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + GenerateWalletsProvider _generateWalletProvider = + Provider.of(context); + CommonElements common = CommonElements(); + this._mnemonicController.text = generatedMnemonic; + + return WillPopScope( + onWillPop: () { + _generateWalletProvider.isAskedWordValid = false; + _generateWalletProvider.askedWordColor = Colors.black; + return Future.value(true); + }, + child: Scaffold( + resizeToAvoidBottomInset: false, + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar( + context, 'Valider ma phrase de restauration', progress), + common.bubbleSpeakRich([ + TextSpan( + text: + "Avez-vous bien noté votre phrase de restauration ?\n\nPour en être sûr, veuillez taper dans le champ ci-dessous le ", + style: TextStyle(fontSize: 16 * ratio)), + TextSpan( + text: '${_generateWalletProvider.nbrWord + 1}ème mot', + style: TextStyle( + fontWeight: FontWeight.bold, fontSize: 16 * ratio)), + TextSpan( + text: " de votre phrase de restauration :", + style: TextStyle(fontSize: 16 * ratio)), + ]), + + // LayoutBuilder(builder: (builder, constraints) { + // // 2 + // var hasDetailPage = constraints.maxWidth > 480; + + // if (hasDetailPage) { + // // 3 + // return Row( + // children: [ + // // 4 + // SizedBox( + // width: 250, + // height: 500, + // child: Text('GRAND'), + // ), + // // 5 + // Expanded( + // child: Text('GRAND 2'), + // ), + // ], + // ); + // } else { + // // 6 + // return Text('PETIT'); + // } + // }), + + // Expanded( + // child: + // //ScreenTypeLayout with custom breakpoints supplied + // ScreenTypeLayout( + // breakpoints: ScreenBreakpoints( + // tablet: 600, + // desktop: 950, + // watch: 480, + // ), + // mobile: Container(color: Colors.blue), + // tablet: Container(color: Colors.yellow), + // desktop: Container(color: Colors.red), + // watch: Container(color: Colors.purple), + // ), + // ), + + SizedBox(height: isTall ? 70 : 10), + if (isTall) + Text('${_generateWalletProvider.nbrWord + 1}', + style: TextStyle( + fontSize: 17, + color: Color(0xffD28928), + fontWeight: FontWeight.w400)), + SizedBox(height: isTall ? 10 : 0), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(7), + border: Border.all( + color: Colors.grey[600], + width: 3, + )), + width: 430, + child: TextFormField( + autofocus: true, + enabled: !_generateWalletProvider.isAskedWordValid, + controller: this.wordController, + textInputAction: TextInputAction.next, + onChanged: (value) { + _generateWalletProvider.checkAskedWord( + value, _mnemonicController.text); + }, + maxLines: 1, + textAlign: TextAlign.center, + decoration: InputDecoration( + labelStyle: TextStyle( + fontSize: 22.0, + color: Colors.grey[500], + fontWeight: FontWeight.w500), + labelText: _generateWalletProvider.isAskedWordValid + ? "C'est le bon mot !" + : "${_generateWalletProvider.nbrWordAlpha} mot de votre phrase de restauration", + fillColor: Colors.grey[300], + filled: true, + contentPadding: EdgeInsets.all(12), + ), + style: TextStyle( + fontSize: 40.0, + color: _generateWalletProvider.askedWordColor, + fontWeight: FontWeight.w500))), + Visibility( + visible: _generateWalletProvider.isAskedWordValid, + child: Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + FaderTransition( + page: OnboardingStepEleven(), + isFast: true), + ); + }, + child: Text("Continuer", + style: TextStyle(fontSize: 20))), + )))), + SizedBox(height: 80), + ]), + ))); + } +} diff --git a/lib/screens/onBoarding/9.dart b/lib/screens/onBoarding/9.dart new file mode 100644 index 0000000..d34f138 --- /dev/null +++ b/lib/screens/onBoarding/9.dart @@ -0,0 +1,63 @@ +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/globals.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/10.dart'; + +// ignore: must_be_immutable +class OnboardingStepEleven extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 8; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + + return Scaffold( + extendBodyBehindAppBar: true, + body: SafeArea( + child: Column(children: [ + common.onboardingProgressBar( + context, 'Ma phrase de restauration', progress), + common.bubbleSpeakRich([ + TextSpan(text: "Super !\n\nJe vais maintenant créer votre "), + TextSpan( + text: 'code secret.', + style: TextStyle(fontWeight: FontWeight.bold)), + TextSpan( + text: + " \n\nVotre code secret chiffre votre trousseau de clefs, ce qui le rend inutilisable par d’autres, par exemple si vous perdez votre téléphone ou si on vous le vole."), + ]), + SizedBox(height: isTall ? 50 : 10), + Image.asset( + 'assets/onBoarding/treasure-chest-gecko-souligne.png', + height: 280 * ratio, //5": 400 + ), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 400, + height: 62, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + FaderTransition( + page: OnboardingStepTwelve(), isFast: true), + ); + }, + child: Text("J'ai compris", + style: TextStyle(fontSize: 20))), + ))), + SizedBox(height: 80), + ]), + )); + } +} diff --git a/lib/screens/settings.dart b/lib/screens/settings.dart index ce0091b..672cd3f 100644 --- a/lib/screens/settings.dart +++ b/lib/screens/settings.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:dubp/dubp.dart'; +import 'package:flutter/services.dart'; import 'package:gecko/models/myWallets.dart'; import 'package:gecko/screens/myWallets/generateWallets.dart'; import 'dart:io'; - import 'package:gecko/screens/myWallets/importWallet.dart'; // ignore: must_be_immutable @@ -23,6 +23,7 @@ class SettingsScreen extends StatelessWidget { @override Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); // getAppDirectory(); return Scaffold( appBar: AppBar( diff --git a/lib/screens/templateScreen.dart b/lib/screens/templateScreen.dart new file mode 100644 index 0000000..6b34bea --- /dev/null +++ b/lib/screens/templateScreen.dart @@ -0,0 +1,83 @@ +import 'package:flutter/services.dart'; +import 'package:gecko/screens/home.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(); + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + // HomeProvider _homeProvider = Provider.of(context); + return Scaffold( + appBar: AppBar( + title: SizedBox( + height: 22, + child: Text('Template screen'), + )), + floatingActionButton: Container( + height: 80.0, + width: 80.0, + child: FittedBox( + child: FloatingActionButton( + heroTag: "tplButton", + onPressed: () => Navigator.push( + context, + MaterialPageRoute(builder: (context) { + return HomeScreen(); + }), + ), + child: Container( + height: 40.0, + width: 40.0, + child: Icon(Icons.home, color: Colors.grey[850]), + ), + backgroundColor: Color( + 0xffEFEFBF), //Color(0xffFFD68E), //Color.fromARGB(500, 204, 255, 255), + ))), + body: SafeArea( + child: Column(children: [ + SizedBox(height: 20), + TextField( + enabled: true, + controller: tplController, + maxLines: 1, + textAlign: TextAlign.center, + decoration: InputDecoration( + contentPadding: EdgeInsets.all(15.0), + ), + style: TextStyle( + fontSize: 22.0, + color: Colors.black, + fontWeight: FontWeight.w400)), + SizedBox(height: 20), + ElevatedButton( + style: ElevatedButton.styleFrom( + primary: Color(0xffFFD68E), // background + onPrimary: Colors.black, // foreground + ), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) { + return HomeScreen(); + }), + ); + }, + child: Text('Retour Accueil', style: TextStyle(fontSize: 20))), + SizedBox(height: 20), + GestureDetector( + onTap: () { + Navigator.popUntil( + context, + ModalRoute.withName('/'), + ); + }, + child: Icon(Icons.home)) + ]), + )); + } +} diff --git a/pubspec.lock b/pubspec.lock index 9a59dae..fdb9a2f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -36,6 +36,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0-nullsafety.1" + bubble: + dependency: "direct main" + description: + name: bubble + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.9+1" catcher: dependency: "direct main" description: @@ -209,6 +216,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.11" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + url: "https://pub.dartlang.org" + source: hosted + version: "0.19.1" flutter_test: dependency: "direct dev" description: flutter @@ -436,6 +450,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0-nullsafety.1" + path_drawing: + dependency: transitive + description: + name: path_drawing + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1+1" path_parsing: dependency: transitive description: @@ -569,6 +590,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.21" + responsive_builder: + dependency: "direct main" + description: + name: responsive_builder + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + responsive_framework: + dependency: "direct main" + description: + name: responsive_framework + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.14" rxdart: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 21961d8..bd65663 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,11 @@ name: gecko -description: A new Flutter project. +description: Pay with G1. # The following line prevents the package from being accidentally published to # 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 -version: 0.0.1+17 +version: 0.0.1+20 environment: sdk: ">=2.7.0 <3.0.0" @@ -38,6 +38,10 @@ dependencies: sentry: ^4.0.4 sentry_flutter: ^4.0.4 catcher: ^0.4.1 + bubble: ^1.1.9+1 + flutter_svg: ^0.19.1 + responsive_framework: ^0.0.14 + responsive_builder: ^0.3.0 flutter_icons: android: "ic_launcher" @@ -56,13 +60,7 @@ flutter: assets: - images/ - config/gva_endpoints.json - - assets/icon/gecko_final.png - assets/ - - assets/OpenSans-Regular.ttf - - assets/icon_user.png - - assets/qrcode-scan.png - - assets/blockchain.png - - assets/block-space.png - - assets/block-space-disabled.png - - assets/lock.png - + - assets/icon/ + - assets/onBoarding/ + - assets/onBoarding/progress_bar/ diff --git a/scripts/multiRun.sh b/scripts/multiRun.sh new file mode 100755 index 0000000..ec7c2e3 --- /dev/null +++ b/scripts/multiRun.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +flutter run -d all + +