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/lib/screens/commonElements.dart b/lib/screens/commonElements.dart index 13ea797..42a633e 100644 --- a/lib/screens/commonElements.dart +++ b/lib/screens/commonElements.dart @@ -1,6 +1,92 @@ 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: new TextSpan( + style: new TextStyle( + fontSize: 18.0, + color: Colors.black, + ), + children: [ + new TextSpan(text: "Munissez-vous d'"), + new TextSpan( + text: 'un papier et d’un crayon\n', + style: new TextStyle(fontWeight: FontWeight.bold)), + new TextSpan( + text: "afin de pouvoir noter votre phrase de restauration."), + ], + )), + ); + } + + Widget onboardingProgressBar(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: 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%', + style: TextStyle(fontSize: 12, color: Colors.black)), + ), + ]); + } + Widget roundButton( AssetImage image, ontap, @@ -81,3 +167,33 @@ class SlideLeftRoute extends PageRouteBuilder { ), ); } + +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/onBoarding/1_noKeychainFound.dart b/lib/screens/onBoarding/1_noKeychainFound.dart index b833445..d916cae 100644 --- a/lib/screens/onBoarding/1_noKeychainFound.dart +++ b/lib/screens/onBoarding/1_noKeychainFound.dart @@ -1,7 +1,8 @@ -import 'package:bubble/bubble.dart'; 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/2_stepOne.dart'; // import 'package:gecko/models/home.dart'; // import 'package:provider/provider.dart'; @@ -13,43 +14,18 @@ class NoKeyChainScreen extends StatelessWidget { @override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); - // HomeProvider _homeProvider = Provider.of(context); + CommonElements common = CommonElements(); return Scaffold( extendBodyBehindAppBar: true, // backgroundColor: Colors.white, // appBar: GeckoSpeechAppBar('Mes portefeuilles'), body: SafeArea( child: Column(children: [ - Stack(children: [ - Container(height: 100), - Positioned( - top: 0, - left: 0, - right: 0, - child: GeckoSpeechAppBar('Mes portefeuilles')), - Positioned( - top: 0, - left: 0, - child: Image.asset( - 'assets/onBoarding/gecko_bar.png', - ), - ), - ]), - Bubble( - padding: BubbleEdges.all(15), - elevation: 5, - color: Colors.white, - margin: BubbleEdges.fromLTRB(10, 0, 20, 10), - // nip: BubbleNip.leftTop, - child: Text( - "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.", - style: TextStyle( - color: Colors.black, - fontSize: 15, - fontWeight: FontWeight.w500), - ), + common.onboardingProgressBar('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: 70), + SizedBox(height: 90), Container( child: ClipOval( child: Material( @@ -57,17 +33,13 @@ class NoKeyChainScreen extends StatelessWidget { child: InkWell( splashColor: Color(0xffD28928), // inkwell color child: Padding( - padding: EdgeInsets.all(12), + padding: EdgeInsets.all(8), child: Image( image: AssetImage('assets/onBoarding/wallet.png'), - height: 75)), + height: 90)), onTap: () { Navigator.push( context, SlideLeftRoute(page: OnboardingStepOne())); - // Navigator.push(context, - // MaterialPageRoute(builder: (context) { - // return OnboardingStepOne(); - // })); }), ), ), @@ -83,13 +55,13 @@ class NoKeyChainScreen extends StatelessWidget { ], ), ), - SizedBox(height: 10), + SizedBox(height: 15), Text( "Créer un nouveau\nportefeuille", textAlign: TextAlign.center, style: TextStyle( color: Colors.black, - fontSize: 13, + fontSize: 16, fontWeight: FontWeight.w500), ), SizedBox(height: 70), @@ -100,11 +72,18 @@ class NoKeyChainScreen extends StatelessWidget { child: InkWell( splashColor: Color(0xffD28928), // inkwell color child: Padding( - padding: EdgeInsets.all(8), - child: Image( - image: AssetImage('assets/onBoarding/cesium.png'), - height: 50)), - onTap: () {}), + 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( @@ -123,39 +102,9 @@ class NoKeyChainScreen extends StatelessWidget { Text( "Importer un\nportefeuille Cesium", textAlign: TextAlign.center, - style: TextStyle(color: Colors.black, fontSize: 10), + style: TextStyle(color: Colors.black, fontSize: 13), ) ]), )); } } - -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/onBoarding/2_stepOne.dart b/lib/screens/onBoarding/2_stepOne.dart index 3307072..873aba0 100644 --- a/lib/screens/onBoarding/2_stepOne.dart +++ b/lib/screens/onBoarding/2_stepOne.dart @@ -1,4 +1,3 @@ -import 'package:bubble/bubble.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/screens/commonElements.dart'; @@ -14,72 +13,27 @@ class OnboardingStepOne extends StatelessWidget { @override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + return Scaffold( extendBodyBehindAppBar: true, body: SafeArea( child: Column(children: [ - Stack(children: [ - Container(height: 100), - Positioned( - top: 0, - left: 0, - right: 0, - child: GeckoSpeechAppBar('Nouveau portefeuilles')), - Positioned( - top: 0, - left: 0, - child: Image.asset( - 'assets/onBoarding/gecko_bar.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/total.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/$progress.png', - ), - ), - Positioned( - top: 66, - right: 45, - child: Text('$progress%', - style: TextStyle(fontSize: 12, color: Colors.black)), - ), - ]), - Bubble( - padding: BubbleEdges.all(15), - elevation: 5, - color: Colors.white, - margin: BubbleEdges.fromLTRB(10, 0, 20, 10), - // nip: BubbleNip.leftTop, - child: Text( - "Il semblerait que vous n’ayez pas encore de trousseau.\n\nUn trousseau vous permet de gérer un ou plusieurs portefeuilles.", - style: TextStyle( - color: Colors.black, - fontSize: 15, - fontWeight: FontWeight.w500), - ), + common.onboardingProgressBar('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, ), - SizedBox(height: 70), - // Row(children: [ - // Align( - // alignment: Alignment.centerRight, - // child: - Image.asset('assets/onBoarding/keys-and-wallets-horizontal.png'), - // ]), Expanded( child: Align( alignment: Alignment.bottomCenter, child: SizedBox( - width: 350, - height: 55, + width: 400, + height: 62, child: ElevatedButton( style: ElevatedButton.styleFrom( elevation: 5, @@ -98,33 +52,3 @@ class OnboardingStepOne extends StatelessWidget { )); } } - -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/onBoarding/3_stepTwo.dart b/lib/screens/onBoarding/3_stepTwo.dart index b844259..7f17867 100644 --- a/lib/screens/onBoarding/3_stepTwo.dart +++ b/lib/screens/onBoarding/3_stepTwo.dart @@ -1,4 +1,3 @@ -import 'package:bubble/bubble.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/screens/commonElements.dart'; @@ -15,120 +14,42 @@ class OnboardingStepTwo extends StatelessWidget { @override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + return Scaffold( extendBodyBehindAppBar: true, body: SafeArea( child: Column(children: [ - Stack(children: [ - Container(height: 100), - Positioned( - top: 0, - left: 0, - right: 0, - child: GeckoSpeechAppBar('Nouveau portefeuilles')), - Positioned( - top: 0, - left: 0, - child: Image.asset( - 'assets/onBoarding/gecko_bar.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/total.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/$progress.png', - ), - ), - Positioned( - top: 66, - right: 45, - child: Text('$progress%', - style: TextStyle(fontSize: 12, color: Colors.black)), - ), - ]), - Bubble( - padding: BubbleEdges.all(15), - elevation: 5, - color: Colors.white, - margin: BubbleEdges.fromLTRB(10, 0, 20, 10), - // nip: BubbleNip.leftTop, - child: Text( - "Un trousseau est créé à partir d’une phrase de restauration.", - style: TextStyle( - color: Colors.black, - fontSize: 15, - fontWeight: FontWeight.w500), - ), + common.onboardingProgressBar('Nouveau portefeuilles', progress), + common.bubbleSpeak( + "Un trousseau est créé à partir d’une phrase de restauration.", ), SizedBox(height: 70), - // Row(children: [ - // Align( - // alignment: Alignment.centerRight, - // child: Image.asset( 'assets/onBoarding/keys-and-wallets-horizontal-plus-phrase.png'), - // ]), Expanded( child: Align( alignment: Alignment.bottomCenter, child: SizedBox( - width: 350, - height: 55, + width: 400, + height: 62, child: ElevatedButton( - style: ElevatedButton.styleFrom( - elevation: 5, - primary: Color(0xffD28928), - onPrimary: Colors.white, // foreground - ), - onPressed: () { - Navigator.push( - context, - SmoothTransition(page: OnboardingStepFor()), - ); - }, - child: Text("J'ai compris", - style: TextStyle(fontSize: 20))), + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + SmoothTransition(page: OnboardingStepFor()), + ); + }, + child: Text("D'accord", style: TextStyle(fontSize: 20)), + ), ))), SizedBox(height: 80), ]), )); } } - -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/onBoarding/4_stepFor.dart b/lib/screens/onBoarding/4_stepFor.dart index 03db225..0d43cce 100644 --- a/lib/screens/onBoarding/4_stepFor.dart +++ b/lib/screens/onBoarding/4_stepFor.dart @@ -1,4 +1,3 @@ -import 'package:bubble/bubble.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/screens/commonElements.dart'; @@ -12,58 +11,15 @@ class OnboardingStepFor extends StatelessWidget { @override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + return Scaffold( extendBodyBehindAppBar: true, body: SafeArea( child: Column(children: [ - Stack(children: [ - Container(height: 100), - Positioned( - top: 0, - left: 0, - right: 0, - child: GeckoSpeechAppBar('Ma phrase de restauration')), - Positioned( - top: 0, - left: 0, - child: Image.asset( - 'assets/onBoarding/gecko_bar.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/total.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/$progress.png', - ), - ), - Positioned( - top: 66, - right: 45, - child: Text('$progress%', - style: TextStyle(fontSize: 12, color: Colors.black)), - ), - ]), - Bubble( - padding: BubbleEdges.all(15), - elevation: 5, - color: Colors.white, - margin: BubbleEdges.fromLTRB(10, 0, 20, 10), - // nip: BubbleNip.leftTop, - child: Text( - "Si un jour vous changez de téléphone, il vous suffira de me redonner votre phrase de restauration pour recréer votre trousseau.", - style: TextStyle( - color: Colors.black, - fontSize: 15, - fontWeight: FontWeight.w500), - ), + common.onboardingProgressBar('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: 10), // Row(children: [ @@ -79,8 +35,8 @@ class OnboardingStepFor extends StatelessWidget { child: Align( alignment: Alignment.bottomCenter, child: SizedBox( - width: 350, - height: 55, + width: 400, + height: 62, child: ElevatedButton( style: ElevatedButton.styleFrom( elevation: 5, @@ -101,33 +57,3 @@ class OnboardingStepFor extends StatelessWidget { )); } } - -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/onBoarding/5_stepFive.dart b/lib/screens/onBoarding/5_stepFive.dart index d1c958e..8c4399f 100644 --- a/lib/screens/onBoarding/5_stepFive.dart +++ b/lib/screens/onBoarding/5_stepFive.dart @@ -1,4 +1,3 @@ -import 'package:bubble/bubble.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/screens/commonElements.dart'; @@ -12,75 +11,27 @@ class OnboardingStepFive extends StatelessWidget { @override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + return Scaffold( extendBodyBehindAppBar: true, body: SafeArea( child: Column(children: [ - Stack(children: [ - Container(height: 100), - Positioned( - top: 0, - left: 0, - right: 0, - child: GeckoSpeechAppBar('Ma phrase de restauration')), - Positioned( - top: 0, - left: 0, - child: Image.asset( - 'assets/onBoarding/gecko_bar.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/total.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/$progress.png', - ), - ), - Positioned( - top: 66, - right: 45, - child: Text('$progress%', - style: TextStyle(fontSize: 12, color: Colors.black)), - ), - ]), - Bubble( - padding: BubbleEdges.all(15), - elevation: 5, - color: Colors.white, - margin: BubbleEdges.fromLTRB(10, 0, 20, 10), - // nip: BubbleNip.leftTop, - child: Text( - "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.", - style: TextStyle( - color: Colors.black, - fontSize: 15, - fontWeight: FontWeight.w500), - ), + common.onboardingProgressBar('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: 10), - // Row(children: [ - // Align( - // alignment: Alignment.centerRight, - // child: Image.asset( 'assets/onBoarding/maison-qui-brule.png', height: 200, ), - // ]), Expanded( child: Align( alignment: Alignment.bottomCenter, child: SizedBox( - width: 350, - height: 55, + width: 400, + height: 62, child: ElevatedButton( style: ElevatedButton.styleFrom( elevation: 5, @@ -101,33 +52,3 @@ class OnboardingStepFive extends StatelessWidget { )); } } - -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/onBoarding/6_stepSix.dart b/lib/screens/onBoarding/6_stepSix.dart index 70918d0..a6a837f 100644 --- a/lib/screens/onBoarding/6_stepSix.dart +++ b/lib/screens/onBoarding/6_stepSix.dart @@ -1,4 +1,3 @@ -import 'package:bubble/bubble.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/screens/commonElements.dart'; @@ -12,75 +11,27 @@ class OnboardingStepSix extends StatelessWidget { @override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + return Scaffold( extendBodyBehindAppBar: true, body: SafeArea( child: Column(children: [ - Stack(children: [ - Container(height: 100), - Positioned( - top: 0, - left: 0, - right: 0, - child: GeckoSpeechAppBar('Ma phrase de restauration')), - Positioned( - top: 0, - left: 0, - child: Image.asset( - 'assets/onBoarding/gecko_bar.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/total.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/$progress.png', - ), - ), - Positioned( - top: 66, - right: 45, - child: Text('$progress%', - style: TextStyle(fontSize: 12, color: Colors.black)), - ), - ]), - Bubble( - padding: BubbleEdges.all(15), - elevation: 5, - color: Colors.white, - margin: BubbleEdges.fromLTRB(10, 0, 20, 10), - // nip: BubbleNip.leftTop, - child: Text( - "Je vais générer votre phrase de restauration ansi que votre trousseau de clef.\n\nC’est moi qui vais décider des mots de votre phrase, parce que sans ça les gens choisissent des choses trop faciles à deviner.", - style: TextStyle( - color: Colors.black, - fontSize: 15, - fontWeight: FontWeight.w500), - ), + common.onboardingProgressBar('Ma phrase de restauration', progress), + common.bubbleSpeak( + "Je vais générer votre phrase de restauration ansi que votre trousseau de clef.\n\nC’est moi qui vais décider des mots de votre phrase, parce que sans ça les gens choisissent des choses trop faciles à deviner.", ), SizedBox(height: 10), - // Row(children: [ - // Align( - // alignment: Alignment.centerRight, - // child: Image.asset( 'assets/onBoarding/good-bad-passphrase.png', height: 300, ), - // ]), Expanded( child: Align( alignment: Alignment.bottomCenter, child: SizedBox( - width: 350, - height: 55, + width: 400, + height: 62, child: ElevatedButton( style: ElevatedButton.styleFrom( elevation: 5, @@ -101,33 +52,3 @@ class OnboardingStepSix extends StatelessWidget { )); } } - -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/onBoarding/7_stepSeven.dart b/lib/screens/onBoarding/7_stepSeven.dart index 8369526..2c0d511 100644 --- a/lib/screens/onBoarding/7_stepSeven.dart +++ b/lib/screens/onBoarding/7_stepSeven.dart @@ -1,4 +1,3 @@ -import 'package:bubble/bubble.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/screens/commonElements.dart'; @@ -12,103 +11,44 @@ class OnboardingStepSeven extends StatelessWidget { @override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + return Scaffold( extendBodyBehindAppBar: true, body: SafeArea( child: Column(children: [ - Stack(children: [ - Container(height: 100), - Positioned( - top: 0, - left: 0, - right: 0, - child: GeckoSpeechAppBar('Ma phrase de restauration')), - Positioned( - top: 0, - left: 0, - child: Image.asset( - 'assets/onBoarding/gecko_bar.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/total.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/$progress.png', - ), - ), - Positioned( - top: 66, - right: 45, - child: Text('$progress%', - style: TextStyle(fontSize: 12, color: Colors.black)), - ), - ]), - Bubble( - padding: BubbleEdges.all(15), - elevation: 5, - color: Colors.white, - margin: BubbleEdges.fromLTRB(10, 0, 20, 10), - // nip: BubbleNip.leftTop, - child: RichText( - text: new TextSpan( - // Note: Styles for TextSpans must be explicitly defined. - // Child text spans will inherit styles from parent - style: new TextStyle( - fontSize: 14.0, - color: Colors.black, - ), - children: [ - new TextSpan(text: "Munissez-vous d'"), - new TextSpan( - text: 'un papier et d’un crayon\n', - style: new TextStyle(fontWeight: FontWeight.bold)), - new TextSpan( - text: - "afin de pouvoir noter votre phrase de restauration."), - ], - )), + common.onboardingProgressBar('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( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - mainAxisSize: MainAxisSize.min, - // crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // SizedBox(width: 50), - Container( - padding: const EdgeInsets.only(bottom: 90), - child: Bubble( - padding: BubbleEdges.all(15), - elevation: 5, - color: Colors.white, - margin: BubbleEdges.fromLTRB(15, 0, 0, 0), - // nip: BubbleNip.leftTop, - child: Text( - 'Moi, j’ai déjà essayé de\nmémoriser une phrase de\nrestauration, mais je n’ai\npas une mémoire\nd’éléphant.', - style: TextStyle(color: Colors.black), - ), - )), - - Image.asset( - 'assets/onBoarding/chopp-gecko.png', - height: 200, - ), - ]), + 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: 50), SizedBox( - width: 350, - height: 55, + width: 400, + height: 62, child: ElevatedButton( style: ElevatedButton.styleFrom( elevation: 5, @@ -129,33 +69,3 @@ class OnboardingStepSeven extends StatelessWidget { )); } } - -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/onBoarding/8_stepEight.dart b/lib/screens/onBoarding/8_stepEight.dart index b72fe30..c165cdf 100644 --- a/lib/screens/onBoarding/8_stepEight.dart +++ b/lib/screens/onBoarding/8_stepEight.dart @@ -1,6 +1,4 @@ import 'dart:ui'; - -import 'package:bubble/bubble.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/screens/commonElements.dart'; @@ -14,71 +12,25 @@ class OnboardingStepEight extends StatelessWidget { @override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + CommonElements common = CommonElements(); + return Scaffold( extendBodyBehindAppBar: true, body: SafeArea( child: Column(children: [ - Stack(children: [ - Container(height: 100), - Positioned( - top: 0, - left: 0, - right: 0, - child: GeckoSpeechAppBar('Ma phrase de restauration')), - Positioned( - top: 0, - left: 0, - child: Image.asset( - 'assets/onBoarding/gecko_bar.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/total.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/$progress.png', - ), - ), - Positioned( - top: 66, - right: 45, - child: Text('$progress%', - style: TextStyle(fontSize: 12, color: Colors.black)), - ), - ]), - Bubble( - padding: BubbleEdges.all(15), - elevation: 5, - color: Colors.white, - margin: BubbleEdges.fromLTRB(10, 0, 20, 10), - // nip: BubbleNip.leftTop, - child: Text( - "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.", - style: TextStyle( - color: Colors.black, - fontSize: 15, - fontWeight: FontWeight.w500), - ), + common.onboardingProgressBar('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: 10), - // ImageFiltered( - // imageFilter: ImageFilter.blur(sigmaX: 2.5, sigmaY: 2.5), - // child: + SizedBox(height: 30), sentanceArray(context), // ), Expanded( child: Align( alignment: Alignment.bottomCenter, child: SizedBox( - width: 350, - height: 55, + width: 400, + height: 62, child: ElevatedButton( style: ElevatedButton.styleFrom( elevation: 5, @@ -100,36 +52,6 @@ class OnboardingStepEight extends StatelessWidget { } } -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), - )); - } -} - Widget sentanceArray(BuildContext context) { return Container( padding: EdgeInsets.symmetric(horizontal: 12), @@ -172,19 +94,19 @@ Widget sentanceArray(BuildContext context) { Widget arrayCell(dataWord) { return Container( - width: 80, + width: 102, child: Column( children: [ ImageFiltered( imageFilter: ImageFilter.blur(sigmaX: 2.5, sigmaY: 2.5), child: Text(dataWord.split(':')[0], - style: TextStyle(fontSize: 12, color: Colors.black)), + style: TextStyle(fontSize: 14, color: Colors.black)), ), SizedBox(height: 2), ImageFiltered( imageFilter: ImageFilter.blur(sigmaX: 3, sigmaY: 3), child: Text(dataWord.split(':')[1], - style: TextStyle(fontSize: 16, color: Colors.black)), + style: TextStyle(fontSize: 20, color: Colors.black)), ) ], )); diff --git a/lib/screens/onBoarding/9_stepNine.dart b/lib/screens/onBoarding/9_stepNine.dart index c7aa4dc..b103faf 100644 --- a/lib/screens/onBoarding/9_stepNine.dart +++ b/lib/screens/onBoarding/9_stepNine.dart @@ -1,4 +1,3 @@ -import 'package:bubble/bubble.dart'; import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; import 'package:gecko/models/generateWallets.dart'; @@ -16,74 +15,20 @@ class OnboardingStepNine extends StatelessWidget { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); GenerateWalletsProvider _generateWalletProvider = Provider.of(context); + CommonElements common = CommonElements(); + // _generateWalletProvider.generateMnemonic(); return Scaffold( extendBodyBehindAppBar: true, body: SafeArea( child: Column(children: [ - Stack(children: [ - Container(height: 100), - Positioned( - top: 0, - left: 0, - right: 0, - child: GeckoSpeechAppBar('Ma phrase de restauration')), - Positioned( - top: 0, - left: 0, - child: Image.asset( - 'assets/onBoarding/gecko_bar.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/total.png', - ), - ), - Positioned( - top: 70, - left: 50, - child: Image.asset( - 'assets/onBoarding/progress_bar/$progress.png', - ), - ), - Positioned( - top: 66, - right: 45, - child: Text('$progress%', - style: TextStyle(fontSize: 12, color: Colors.black)), - ), - ]), - Bubble( - padding: BubbleEdges.fromLTRB(40, 15, 40, 15), - elevation: 5, - color: Colors.white, - margin: BubbleEdges.fromLTRB(10, 0, 20, 10), - // nip: BubbleNip.leftTop, - child: Text( - "C’est le moment de noter votre phrase !", - style: TextStyle( - color: Colors.black, - fontSize: 15, - fontWeight: FontWeight.w500), - ), + common.onboardingProgressBar('Ma phrase de restauration', progress), + common.bubbleSpeak( + "C’est le moment de noter votre phrase !", + long: 60, ), - SizedBox(height: 64), - // TextField( - // enabled: false, - // controller: _generateWalletProvider.mnemonicController, - // maxLines: 3, - // textAlign: TextAlign.center, - // decoration: InputDecoration( - // contentPadding: EdgeInsets.all(15.0), - // ), - // style: TextStyle( - // fontSize: 22.0, - // color: Colors.black, - // fontWeight: FontWeight.w400)), + SizedBox(height: 69), sentanceArray(context), SizedBox(height: 15), GestureDetector( @@ -104,8 +49,8 @@ class OnboardingStepNine extends StatelessWidget { child: Align( alignment: Alignment.bottomCenter, child: SizedBox( - width: 350, - height: 55, + width: 400, + height: 62, child: ElevatedButton( style: ElevatedButton.styleFrom( elevation: 5, @@ -120,8 +65,8 @@ class OnboardingStepNine extends StatelessWidget { ))), SizedBox(height: 25), SizedBox( - width: 350, - height: 55, + width: 400, + height: 62, child: ElevatedButton( style: ElevatedButton.styleFrom( elevation: 5, @@ -143,38 +88,6 @@ class OnboardingStepNine extends StatelessWidget { } } -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), - )); - } -} - -// _generateWalletProvider - Widget sentanceArray(BuildContext context) { GenerateWalletsProvider _generateWalletProvider = Provider.of(context); @@ -225,12 +138,12 @@ Widget sentanceArray(BuildContext context) { Widget arrayCell(dataWord) { return Container( - width: 80, + width: 102, child: Column(children: [ - Text(dataWord.split(':')[0], style: TextStyle(fontSize: 12)), + Text(dataWord.split(':')[0], style: TextStyle(fontSize: 14)), SizedBox(height: 2), Text(dataWord.split(':')[1], - style: TextStyle(fontSize: 16, color: Colors.black)), + style: TextStyle(fontSize: 19, color: Colors.black)), ])); } diff --git a/pubspec.lock b/pubspec.lock index ea1bcdd..fecaf04 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -216,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 @@ -443,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: diff --git a/pubspec.yaml b/pubspec.yaml index 15e62dd..bfe7ebd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -40,6 +40,7 @@ dependencies: catcher: ^0.4.1 bubble: ^1.1.9+1 responsive_framework: ^0.0.14 + flutter_svg: ^0.19.1 flutter_icons: android: "ic_launcher"