diff --git a/lib/screens/commonElements.dart b/lib/screens/commonElements.dart index cb3ecd4012ce8a5d937cfa64c48f9a07a6dc63f4..da74024cf143299a20209ceaabc5a17a75c978fe 100644 --- a/lib/screens/commonElements.dart +++ b/lib/screens/commonElements.dart @@ -135,6 +135,32 @@ class SmoothTransition extends PageRouteBuilder { ); } +class FaderTransition extends PageRouteBuilder { + final Widget page; + final bool isFast; + + FaderTransition({@required this.page, @required this.isFast}) + : super( + pageBuilder: ( + BuildContext context, + Animation<double> animation, + Animation<double> secondaryAnimation, + ) => + page, + transitionsBuilder: ( + BuildContext context, + Animation<double> animation, + Animation<double> 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}) diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 0fdf06a32ad9288af2bd1dc7fe5dafe230920ce3..b16b8ac29e30a9eeb7599dcc588824d416511d76 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -4,7 +4,7 @@ import 'package:gecko/models/history.dart'; import 'package:gecko/models/home.dart'; import 'package:flutter/material.dart'; import 'package:gecko/models/myWallets.dart'; -import 'package:gecko/screens/onBoarding/1_noKeychainFound.dart'; +import 'package:gecko/screens/onBoarding/0_noKeychainFound.dart'; import 'dart:ui'; import 'package:gecko/screens/settings.dart'; import 'package:flutter/services.dart'; diff --git a/lib/screens/myWallets/walletsHome.dart b/lib/screens/myWallets/walletsHome.dart index 98f88f4ed5274c9c2d97991cffd2ef1a00f00691..d7ddd8482b8b7a7f494f1ad1dcdbc08fdd748e87 100644 --- a/lib/screens/myWallets/walletsHome.dart +++ b/lib/screens/myWallets/walletsHome.dart @@ -3,7 +3,7 @@ import 'package:gecko/models/myWallets.dart'; import 'package:gecko/models/walletOptions.dart'; import 'package:flutter/material.dart'; import 'package:gecko/screens/myWallets/unlockingWallet.dart'; -import 'package:gecko/screens/onBoarding/1_noKeychainFound.dart'; +import 'package:gecko/screens/onBoarding/0_noKeychainFound.dart'; import 'package:provider/provider.dart'; // ignore: must_be_immutable diff --git a/lib/screens/onBoarding/1_noKeychainFound.dart b/lib/screens/onBoarding/0_noKeychainFound.dart similarity index 95% rename from lib/screens/onBoarding/1_noKeychainFound.dart rename to lib/screens/onBoarding/0_noKeychainFound.dart index d916cae7f5748624986a0f293f36793831b8d54f..e4b547f2f4e7b7ee6cc1ab1af0b4e423e3abc9a3 100644 --- a/lib/screens/onBoarding/1_noKeychainFound.dart +++ b/lib/screens/onBoarding/0_noKeychainFound.dart @@ -3,7 +3,7 @@ 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/2_stepOne.dart'; +import 'package:gecko/screens/onBoarding/1.dart'; // import 'package:gecko/models/home.dart'; // import 'package:provider/provider.dart'; @@ -39,7 +39,9 @@ class NoKeyChainScreen extends StatelessWidget { height: 90)), onTap: () { Navigator.push( - context, SlideLeftRoute(page: OnboardingStepOne())); + context, + FaderTransition( + page: OnboardingStepOne(), isFast: true)); }), ), ), diff --git a/lib/screens/onBoarding/2_stepOne.dart b/lib/screens/onBoarding/1.dart similarity index 93% rename from lib/screens/onBoarding/2_stepOne.dart rename to lib/screens/onBoarding/1.dart index 190e40fa53d0ac36731ee4a976d7ab9938015c94..2c8bf9616de70bff1b027aa31c3d09155e2e655e 100644 --- a/lib/screens/onBoarding/2_stepOne.dart +++ b/lib/screens/onBoarding/1.dart @@ -1,7 +1,7 @@ import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/screens/commonElements.dart'; -import 'package:gecko/screens/onBoarding/3_stepTwo.dart'; +import 'package:gecko/screens/onBoarding/2.dart'; // import 'package:gecko/models/home.dart'; // import 'package:provider/provider.dart'; @@ -42,7 +42,7 @@ class OnboardingStepOne extends StatelessWidget { ), onPressed: () { Navigator.push(context, - SmoothTransition(page: OnboardingStepTwo())); + FaderTransition(page: OnboardingStepTwo(), isFast: true)); }, child: Text('Créer mon trousseau', style: TextStyle(fontSize: 20))), diff --git a/lib/screens/onBoarding/12_stepTwelve.dart b/lib/screens/onBoarding/10.dart similarity index 93% rename from lib/screens/onBoarding/12_stepTwelve.dart rename to lib/screens/onBoarding/10.dart index a841e4ff356626e1c9daa92e7bb57f39acd43a4c..4bf73713e68403dd326952c75f9122f0b42784a4 100644 --- a/lib/screens/onBoarding/12_stepTwelve.dart +++ b/lib/screens/onBoarding/10.dart @@ -2,7 +2,7 @@ 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/13_stepThirteen.dart'; +import 'package:gecko/screens/onBoarding/11.dart'; // ignore: must_be_immutable class OnboardingStepTwelve extends StatelessWidget { @@ -41,7 +41,7 @@ class OnboardingStepTwelve extends StatelessWidget { onPressed: () { Navigator.push( context, - SmoothTransition(page: OnboardingStepThirteen()), + FaderTransition(page: OnboardingStepThirteen(), isFast: true), ); }, child: Text("Générer le code secret", diff --git a/lib/screens/onBoarding/13_stepThirteen.dart b/lib/screens/onBoarding/11.dart similarity index 96% rename from lib/screens/onBoarding/13_stepThirteen.dart rename to lib/screens/onBoarding/11.dart index 04c5eaeb8258172f6e2a0e1bb22c7cbb99f4ec3b..f552b075885e1aecdb966d5f0cc7e70510271d72 100644 --- a/lib/screens/onBoarding/13_stepThirteen.dart +++ b/lib/screens/onBoarding/11.dart @@ -4,7 +4,7 @@ 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/14_stepFourteen.dart'; +import 'package:gecko/screens/onBoarding/12.dart'; import 'package:provider/provider.dart'; // ignore: must_be_immutable @@ -106,9 +106,9 @@ class OnboardingStepThirteen extends StatelessWidget { _generateWalletProvider.askedWordColor = Colors.black; Navigator.push( context, - SmoothTransition( + FaderTransition( page: OnboardingStepFourteen( - generatedWallet: generatedWallet)), + generatedWallet: generatedWallet), isFast: true), ); }, child: Text("J'ai noté mon code secret", diff --git a/lib/screens/onBoarding/14_stepFourteen.dart b/lib/screens/onBoarding/12.dart similarity index 96% rename from lib/screens/onBoarding/14_stepFourteen.dart rename to lib/screens/onBoarding/12.dart index 3f1b0867e5215b9d7083d5ee8d97dc6dcfc3d4ca..01294e54887b411e397c94c5e99da186423dced2 100644 --- a/lib/screens/onBoarding/14_stepFourteen.dart +++ b/lib/screens/onBoarding/12.dart @@ -8,7 +8,7 @@ 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/15_stepFiveteen.dart'; +import 'package:gecko/screens/onBoarding/13_congratulations.dart'; import 'package:pin_code_fields/pin_code_fields.dart'; import 'package:provider/provider.dart'; @@ -123,7 +123,8 @@ class OnboardingStepFourteen extends StatelessWidget { _myWalletProvider.rebuildWidget(); Navigator.push( context, - SmoothTransition(page: OnboardingStepFiveteen()), + FaderTransition( + page: OnboardingStepFiveteen(), isFast: false), ); } else { errorController.add(ErrorAnimationType diff --git a/lib/screens/onBoarding/15_stepFiveteen.dart b/lib/screens/onBoarding/13_congratulations.dart similarity index 100% rename from lib/screens/onBoarding/15_stepFiveteen.dart rename to lib/screens/onBoarding/13_congratulations.dart diff --git a/lib/screens/onBoarding/3_stepTwo.dart b/lib/screens/onBoarding/2.dart similarity index 93% rename from lib/screens/onBoarding/3_stepTwo.dart rename to lib/screens/onBoarding/2.dart index b523c07db41c74e5fb067b63ff5d4afcb95addc4..f2491f178cc2531b538cb2ffa14f9623f23eca1a 100644 --- a/lib/screens/onBoarding/3_stepTwo.dart +++ b/lib/screens/onBoarding/2.dart @@ -1,7 +1,7 @@ import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/screens/commonElements.dart'; -import 'package:gecko/screens/onBoarding/4_stepFor.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'; @@ -42,7 +42,7 @@ class OnboardingStepTwo extends StatelessWidget { onPressed: () { Navigator.push( context, - SmoothTransition(page: OnboardingStepFor()), + FaderTransition(page: OnboardingStepFor(), isFast: true), ); }, child: Text("D'accord", style: TextStyle(fontSize: 20)), diff --git a/lib/screens/onBoarding/4_stepFor.dart b/lib/screens/onBoarding/3.dart similarity index 93% rename from lib/screens/onBoarding/4_stepFor.dart rename to lib/screens/onBoarding/3.dart index 8df36eee9f4964725d95220db487023af3bb88eb..bf11c93ad704ae9b521044e1d13c0803ad3db1e9 100644 --- a/lib/screens/onBoarding/4_stepFor.dart +++ b/lib/screens/onBoarding/3.dart @@ -2,7 +2,7 @@ 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_stepFive.dart'; +import 'package:gecko/screens/onBoarding/4.dart'; // ignore: must_be_immutable class OnboardingStepFor extends StatelessWidget { @@ -47,7 +47,7 @@ class OnboardingStepFor extends StatelessWidget { onPressed: () { Navigator.push( context, - SmoothTransition(page: OnboardingStepFive()), + FaderTransition(page: OnboardingStepFive(), isFast: true), ); }, child: Text("J'ai compris", diff --git a/lib/screens/onBoarding/5_stepFive.dart b/lib/screens/onBoarding/4.dart similarity index 93% rename from lib/screens/onBoarding/5_stepFive.dart rename to lib/screens/onBoarding/4.dart index 4a9f289c71fbf7aaaa1b8d9a7f907ea716706421..87b3880c706d9c5af3195e66211d0a2bd3124ba5 100644 --- a/lib/screens/onBoarding/5_stepFive.dart +++ b/lib/screens/onBoarding/4.dart @@ -2,7 +2,7 @@ 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_stepSeven.dart'; +import 'package:gecko/screens/onBoarding/5.dart'; // ignore: must_be_immutable class OnboardingStepFive extends StatelessWidget { @@ -42,7 +42,7 @@ class OnboardingStepFive extends StatelessWidget { onPressed: () { Navigator.push( context, - SmoothTransition(page: OnboardingStepSeven()), + FaderTransition(page: OnboardingStepSeven(), isFast: true), ); }, child: Text("J'ai compris", diff --git a/lib/screens/onBoarding/7_stepSeven.dart b/lib/screens/onBoarding/5.dart similarity index 95% rename from lib/screens/onBoarding/7_stepSeven.dart rename to lib/screens/onBoarding/5.dart index b98dc82a5a2408a2d53d34df08bb93a0f3de50e0..af61bb25f4e70022d660ee2a012307435fcc8b59 100644 --- a/lib/screens/onBoarding/7_stepSeven.dart +++ b/lib/screens/onBoarding/5.dart @@ -2,7 +2,7 @@ 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/8_stepEight.dart'; +import 'package:gecko/screens/onBoarding/6.dart'; // ignore: must_be_immutable class OnboardingStepSeven extends StatelessWidget { @@ -59,7 +59,7 @@ class OnboardingStepSeven extends StatelessWidget { onPressed: () { Navigator.push( context, - SmoothTransition(page: OnboardingStepEight()), + FaderTransition(page: OnboardingStepEight(), isFast: true), ); }, child: Text("J'ai de quoi noter", diff --git a/lib/screens/onBoarding/8_stepEight.dart b/lib/screens/onBoarding/6.dart similarity index 92% rename from lib/screens/onBoarding/8_stepEight.dart rename to lib/screens/onBoarding/6.dart index 685d934d1459e11f3461d6b97d07651b2948cec2..9a09fb84238a2469eae5773f1321e02df412fe21 100644 --- a/lib/screens/onBoarding/8_stepEight.dart +++ b/lib/screens/onBoarding/6.dart @@ -3,7 +3,7 @@ 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/9_stepNine.dart'; +import 'package:gecko/screens/onBoarding/7.dart'; // ignore: must_be_immutable class OnboardingStepEight extends StatelessWidget { @@ -42,7 +42,8 @@ class OnboardingStepEight extends StatelessWidget { onPressed: () { Navigator.push( context, - SmoothTransition(page: OnboardingStepNine()), + FaderTransition( + page: OnboardingStepNine(), isFast: false), ); }, child: Text("Afficher ma phrase", @@ -100,13 +101,13 @@ Widget arrayCell(dataWord) { child: Column( children: <Widget>[ ImageFiltered( - imageFilter: ImageFilter.blur(sigmaX: 2.5, sigmaY: 2.5), + 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: 3, sigmaY: 3), + 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/9_stepNine.dart b/lib/screens/onBoarding/7.dart similarity index 94% rename from lib/screens/onBoarding/9_stepNine.dart rename to lib/screens/onBoarding/7.dart index baf95102237ace304f0e02e9c1d1135c39deff2f..36a0abc264dd643912518260e3f8b08a20a605ff 100644 --- a/lib/screens/onBoarding/9_stepNine.dart +++ b/lib/screens/onBoarding/7.dart @@ -3,7 +3,7 @@ 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/10_stepTen.dart'; +import 'package:gecko/screens/onBoarding/8.dart'; import 'package:printing/printing.dart'; import 'package:provider/provider.dart'; @@ -84,12 +84,13 @@ class OnboardingStepNine extends StatelessWidget { Navigator.push( context, - SmoothTransition( + FaderTransition( page: OnboardingStepTen( generatedMnemonic: _generateWalletProvider.generatedMnemonic, generatedWallet: - _generateWalletProvider.actualWallet)), + _generateWalletProvider.actualWallet), + isFast: true), ); }, child: Text("J'ai noté ma phrase", @@ -107,7 +108,20 @@ Widget sentanceArray(BuildContext context) { return FutureBuilder( future: _generateWalletProvider.generateWordList(), - initialData: '::::::::::::', + initialData: [ + '1:...', + '2:...', + '3:...', + '4:...', + '5:...', + '6:...', + '7:...', + '8:...', + '9:...', + '10:...', + '11:...', + '12:...', + ], builder: (context, formatedArray) { return Container( padding: EdgeInsets.symmetric(horizontal: 12), diff --git a/lib/screens/onBoarding/10_stepTen.dart b/lib/screens/onBoarding/8.dart similarity index 98% rename from lib/screens/onBoarding/10_stepTen.dart rename to lib/screens/onBoarding/8.dart index 9df37abd98dd11c15a5a7e1b516a6063abfcfea5..0b16f08bbc9e5e65a5370f067fd9cc9ddee80549 100644 --- a/lib/screens/onBoarding/10_stepTen.dart +++ b/lib/screens/onBoarding/8.dart @@ -5,7 +5,7 @@ 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/11_stepEleven.dart'; +import 'package:gecko/screens/onBoarding/9.dart'; import 'package:provider/provider.dart'; // ignore: must_be_immutable @@ -163,8 +163,8 @@ class OnboardingStepTen extends StatelessWidget { onPressed: () { Navigator.push( context, - SmoothTransition( - page: OnboardingStepEleven()), + FaderTransition( + page: OnboardingStepEleven(), isFast: true), ); }, child: Text("Continuer", diff --git a/lib/screens/onBoarding/11_stepEleven.dart b/lib/screens/onBoarding/9.dart similarity index 94% rename from lib/screens/onBoarding/11_stepEleven.dart rename to lib/screens/onBoarding/9.dart index c18680611839bc48d6f9f5fd9c140a5d1c6ad4ea..4ce102837cb021abf3a1be64d5b77fb44525146c 100644 --- a/lib/screens/onBoarding/11_stepEleven.dart +++ b/lib/screens/onBoarding/9.dart @@ -2,7 +2,7 @@ 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/12_stepTwelve.dart'; +import 'package:gecko/screens/onBoarding/10.dart'; // ignore: must_be_immutable class OnboardingStepEleven extends StatelessWidget { @@ -48,7 +48,7 @@ class OnboardingStepEleven extends StatelessWidget { onPressed: () { Navigator.push( context, - SmoothTransition(page: OnboardingStepTwelve()), + FaderTransition(page: OnboardingStepTwelve(), isFast: true), ); }, child: Text("J'ai compris",