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/lib/screens/commonElements.dart b/lib/screens/commonElements.dart index 9f4b07e..13ea797 100644 --- a/lib/screens/commonElements.dart +++ b/lib/screens/commonElements.dart @@ -36,3 +36,48 @@ class CommonElements { ); } } + +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 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, + ), + ); +} diff --git a/lib/screens/home.dart b/lib/screens/home.dart index d5b33de..3ce9452 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -4,7 +4,6 @@ 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/commonElements.dart'; import 'package:gecko/screens/myWallets/walletsHome.dart'; import 'package:gecko/screens/onBoarding/1_noKeychainFound.dart'; import 'dart:ui'; diff --git a/lib/screens/onBoarding/1_noKeychainFound.dart b/lib/screens/onBoarding/1_noKeychainFound.dart index 712e725..b833445 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:gecko/screens/home.dart'; import 'package:flutter/material.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/2_stepOne.dart'; // import 'package:gecko/models/home.dart'; // import 'package:provider/provider.dart'; @@ -60,7 +61,14 @@ class NoKeyChainScreen extends StatelessWidget { child: Image( image: AssetImage('assets/onBoarding/wallet.png'), height: 75)), - onTap: () {}), + onTap: () { + Navigator.push( + context, SlideLeftRoute(page: OnboardingStepOne())); + // Navigator.push(context, + // MaterialPageRoute(builder: (context) { + // return OnboardingStepOne(); + // })); + }), ), ), decoration: BoxDecoration( @@ -122,27 +130,6 @@ class NoKeyChainScreen extends StatelessWidget { } } -// class GeckoSpeechAppBar extends StatelessWidget with PreferredSizeWidget { - -// } -// // Widget build(BuildContext context) { -// // return AppBar( -// // leading: IconButton( -// // icon: Container( -// // height: 100, -// // child: Image.asset('assets/onBoarding/gecko_bar.png')), -// // onPressed: () => Navigator.popUntil( -// // context, -// // ModalRoute.withName('/'), -// // ), -// // ), -// // title: SizedBox( -// // height: 22, -// // child: Text('Mes portefeuilles'), -// // )); -// // } -// } - class GeckoSpeechAppBar extends StatelessWidget with PreferredSizeWidget { @override final Size preferredSize; @@ -156,29 +143,6 @@ class GeckoSpeechAppBar extends StatelessWidget with PreferredSizeWidget { @override Widget build(BuildContext context) { - // return PreferredSize( - // preferredSize: Size(MediaQuery.of(context).size.width, 200), - // child: Container( - // child: Stack( - // alignment: Alignment.topLeft, - // children: [ - // Container( - // color: Color(0xffFFD68E), - // width: MediaQuery.of(context).size.width, - // height: 100, - // ), - // Container( - // // width: 100, - // height: 200, - // child: Column(children: [ - // SizedBox(height: 61.5), - // Image.asset('assets/onBoarding/gecko_bar.png') - // ]), - // ), - // ], - // ), - // ), - // ); return AppBar( leading: IconButton( icon: Container( diff --git a/lib/screens/onBoarding/2_stepOne.dart b/lib/screens/onBoarding/2_stepOne.dart new file mode 100644 index 0000000..3307072 --- /dev/null +++ b/lib/screens/onBoarding/2_stepOne.dart @@ -0,0 +1,130 @@ +import 'package:bubble/bubble.dart'; +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/models/home.dart'; +// import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class OnboardingStepOne extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 8; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + 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), + ), + ), + 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, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push(context, + SmoothTransition(page: OnboardingStepTwo())); + }, + child: Text('Créer mon trousseau', + 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/3_stepTwo.dart b/lib/screens/onBoarding/3_stepTwo.dart new file mode 100644 index 0000000..b844259 --- /dev/null +++ b/lib/screens/onBoarding/3_stepTwo.dart @@ -0,0 +1,134 @@ +import 'package:bubble/bubble.dart'; +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/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 = 17; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + 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), + ), + ), + 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, + 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))), + ))), + 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 new file mode 100644 index 0000000..03db225 --- /dev/null +++ b/lib/screens/onBoarding/4_stepFor.dart @@ -0,0 +1,133 @@ +import 'package:bubble/bubble.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/5_stepFive.dart'; + +// ignore: must_be_immutable +class OnboardingStepFor extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 20; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + 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), + ), + ), + SizedBox(height: 10), + // Row(children: [ + // Align( + // alignment: Alignment.centerRight, + // child: + Image.asset( + 'assets/onBoarding/plusieurs-appareils-un-trousseau.png', + height: 350, + ), + // ]), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 350, + height: 55, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + SmoothTransition(page: OnboardingStepFive()), + ); + }, + child: Text("J'ai compris", + 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/5_stepFive.dart b/lib/screens/onBoarding/5_stepFive.dart new file mode 100644 index 0000000..d1c958e --- /dev/null +++ b/lib/screens/onBoarding/5_stepFive.dart @@ -0,0 +1,133 @@ +import 'package:bubble/bubble.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/6_stepSix.dart'; + +// ignore: must_be_immutable +class OnboardingStepFive extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 25; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + 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), + ), + ), + 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, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + SmoothTransition(page: OnboardingStepSix()), + ); + }, + child: Text("J'ai compris", + 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/6_stepSix.dart b/lib/screens/onBoarding/6_stepSix.dart new file mode 100644 index 0000000..70918d0 --- /dev/null +++ b/lib/screens/onBoarding/6_stepSix.dart @@ -0,0 +1,133 @@ +import 'package:bubble/bubble.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/7_stepSeven.dart'; + +// ignore: must_be_immutable +class OnboardingStepSix extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 28; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + 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), + ), + ), + 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, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + SmoothTransition(page: OnboardingStepSeven()), + ); + }, + child: Text("Je comprends", + 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/7_stepSeven.dart b/lib/screens/onBoarding/7_stepSeven.dart new file mode 100644 index 0000000..8369526 --- /dev/null +++ b/lib/screens/onBoarding/7_stepSeven.dart @@ -0,0 +1,161 @@ +import 'package:bubble/bubble.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/8_stepEight.dart'; + +// ignore: must_be_immutable +class OnboardingStepSeven extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 33; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + 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."), + ], + )), + ), + 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, + ), + ]), + )), + SizedBox(height: 50), + SizedBox( + width: 350, + height: 55, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + SmoothTransition(page: OnboardingStepEight()), + ); + }, + child: Text("J'ai de quoi noter", + 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/8_stepEight.dart b/lib/screens/onBoarding/8_stepEight.dart new file mode 100644 index 0000000..2601f20 --- /dev/null +++ b/lib/screens/onBoarding/8_stepEight.dart @@ -0,0 +1,134 @@ +import 'package:bubble/bubble.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/material.dart'; +import 'package:gecko/screens/commonElements.dart'; +import 'package:gecko/screens/onBoarding/7_stepSeven.dart'; +import 'package:gecko/screens/onBoarding/9_stepNine.dart'; + +// ignore: must_be_immutable +class OnboardingStepEight extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 42; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + 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), + ), + ), + SizedBox(height: 10), + // Row(children: [ + // Align( + // alignment: Alignment.centerRight, + // child: + Image.asset( + 'assets/onBoarding/phrase_de_restauration_flou.png', + height: 300, + ), + // ]), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 350, + height: 55, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + Navigator.push( + context, + SmoothTransition(page: OnboardingStepNine()), + ); + }, + child: Text("Afficher ma phrase", + 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/9_stepNine.dart b/lib/screens/onBoarding/9_stepNine.dart new file mode 100644 index 0000000..973f967 --- /dev/null +++ b/lib/screens/onBoarding/9_stepNine.dart @@ -0,0 +1,146 @@ +import 'package:bubble/bubble.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:provider/provider.dart'; + +// ignore: must_be_immutable +class OnboardingStepNine extends StatelessWidget { + TextEditingController tplController = TextEditingController(); + final int progress = 50; + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + GenerateWalletsProvider _generateWalletProvider = + Provider.of(context); + _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), + ), + ), + SizedBox(height: 64), + // Row(children: [ + // Align( + // alignment: Alignment.centerRight, + // child: + 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)), + // ]), + Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: SizedBox( + width: 350, + height: 55, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 5, + primary: Color(0xffD28928), + onPrimary: Colors.white, // foreground + ), + onPressed: () { + // Navigator.push( + // context, + // SmoothTransition(page: OnboardingStepNince()), + // ); + }, + child: Text("J'ai noté ma phrase", + 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/pubspec.yaml b/pubspec.yaml index 07da75a..7a4f952 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -57,16 +57,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/onBoarding/gecko_bar.png - - assets/onBoarding/wallet.png - - assets/onBoarding/cesium.png - + - assets/icon/ + - assets/onBoarding/ + - assets/onBoarding/progress_bar/ \ No newline at end of file