diff --git a/lib/screens/common_elements.dart b/lib/screens/common_elements.dart index d5f0951..4763d6c 100644 --- a/lib/screens/common_elements.dart +++ b/lib/screens/common_elements.dart @@ -30,23 +30,8 @@ class CommonElements { child: Image.asset('assets/onBoarding/$assetName', width: imageWidth)); } - Widget buildText(String text, [double size = 20]) { - return Container( - padding: const EdgeInsets.all(12), - width: 440, - decoration: BoxDecoration( - color: Colors.white, border: Border.all(color: Colors.grey[900]!)), - child: Text(text, - textAlign: TextAlign.justify, - style: TextStyle( - fontSize: isTall ? size : size * 0.9, - color: Colors.black, - letterSpacing: 0.3)), - ); - } - - Widget buildTextMd(String text, [double size = 20]) { - final style = MarkdownStyleSheet( + Widget buildText(String text, [double size = 20, bool isMd = false]) { + final mdStyle = MarkdownStyleSheet( p: TextStyle( fontSize: isTall ? size : size * 0.9, color: Colors.black, @@ -55,11 +40,19 @@ class CommonElements { ); return Container( - padding: const EdgeInsets.all(12), - width: 440, - decoration: BoxDecoration( - color: Colors.white, border: Border.all(color: Colors.grey[900]!)), - child: MarkdownBody(data: text, styleSheet: style)); + padding: const EdgeInsets.all(12), + width: 440, + decoration: BoxDecoration( + color: Colors.white, border: Border.all(color: Colors.grey[900]!)), + child: isMd + ? MarkdownBody(data: text, styleSheet: mdStyle) + : Text(text, + textAlign: TextAlign.justify, + style: TextStyle( + fontSize: isTall ? size : size * 0.9, + color: Colors.black, + letterSpacing: 0.3)), + ); } Widget nextButton( @@ -104,7 +97,7 @@ class CommonElements { String buttonText, nextScreen, double pagePosition, { - String? textMd, + bool isMd = false, bool isFast = false, double boxHeight = 440, double imageWidth = 350, @@ -115,10 +108,7 @@ class CommonElements { buildProgressBar(pagePosition), SizedBox(height: isTall ? 40 : 20), - if (textMd == null) - buildText(text, textSize) - else - buildTextMd(textMd, textSize), + buildText(text, textSize, isMd), buildImage(assetName, boxHeight, imageWidth), Expanded( diff --git a/lib/screens/onBoarding/1.dart b/lib/screens/onBoarding/1.dart index 9162f8f..338c7a1 100644 --- a/lib/screens/onBoarding/1.dart +++ b/lib/screens/onBoarding/1.dart @@ -29,12 +29,12 @@ class OnboardingStepOne extends StatelessWidget { body: SafeArea( child: common.infoIntro( context, - '', + 'geckoGenerateYourWalletFromMnemonic'.tr(), 'fabrication-de-portefeuille.png', '>', const OnboardingStepTwo(), 0, - textMd: 'geckoGenerateYourWalletFromMnemonic'.tr(), + isMd: true, ), ), ); diff --git a/lib/screens/onBoarding/4.dart b/lib/screens/onBoarding/4.dart index e1fb0b4..c8a6c01 100644 --- a/lib/screens/onBoarding/4.dart +++ b/lib/screens/onBoarding/4.dart @@ -28,10 +28,14 @@ class OnboardingStepFor extends StatelessWidget { ), extendBodyBehindAppBar: true, body: SafeArea( - child: common.infoIntro(context, '', 'gecko-oublie-aussi.png', '>', - const OnboardingStepFive(), 3, - textMd: - 'Il est temps de vous munir d’**un papier et d’un crayon** afin de pouvoir noter votre phrase de restauration.'), + child: common.infoIntro( + context, + 'Il est temps de vous munir d’**un papier et d’un crayon** afin de pouvoir noter votre phrase de restauration.', + 'gecko-oublie-aussi.png', + '>', + const OnboardingStepFive(), + 3, + isMd: true), ), ); } diff --git a/lib/screens/onBoarding/6.dart b/lib/screens/onBoarding/6.dart index f2009ed..a4fa2aa 100644 --- a/lib/screens/onBoarding/6.dart +++ b/lib/screens/onBoarding/6.dart @@ -56,9 +56,10 @@ class OnboardingStepSix extends StatelessWidget { SizedBox(height: isTall ? 40 : 20), common.buildProgressBar(5), SizedBox(height: isTall ? 40 : 20), - common.buildTextMd( - "Avez-vous bien noté votre phrase de restauration ?\n\nPour en être sûr, veuillez taper dans le champ ci-dessous le **${_generateWalletProvider.nbrWord + 1}ème mot** de votre phrase de restauration :", - ), + common.buildText( + "Avez-vous bien noté votre phrase de restauration ?\n\nPour en être sûr, veuillez taper dans le champ ci-dessous le **${_generateWalletProvider.nbrWord + 1}ème mot** de votre phrase de restauration :", + 20, + true), SizedBox(height: isTall ? 70 : 20), Text('${_generateWalletProvider.nbrWord + 1}', key: const Key('askedWord'), diff --git a/lib/screens/onBoarding/8.dart b/lib/screens/onBoarding/8.dart index e85c6e7..ff7a401 100644 --- a/lib/screens/onBoarding/8.dart +++ b/lib/screens/onBoarding/8.dart @@ -30,13 +30,12 @@ class OnboardingStepEight extends StatelessWidget { body: SafeArea( child: common.infoIntro( context, - '', + 'Ce code secret protège vos portefeuilles dans un coffre-fort **dont vous seul possédez le code**, de sorte que vos portefeuilles seront inutilisables par d’autres.', 'coffre-fort-protege-les-portefeuilles.png', '>', OnboardingStepNine(scanDerivation: scanDerivation), 7, - textMd: - 'Ce code secret protège vos portefeuilles dans un coffre-fort **dont vous seul possédez le code**, de sorte que vos portefeuilles seront inutilisables par d’autres.'), + isMd: true), ), ); } diff --git a/lib/screens/onBoarding/9.dart b/lib/screens/onBoarding/9.dart index ea06ac4..8f26873 100644 --- a/lib/screens/onBoarding/9.dart +++ b/lib/screens/onBoarding/9.dart @@ -44,8 +44,10 @@ class OnboardingStepNine extends StatelessWidget { SizedBox(height: isTall ? 40 : 20), common.buildProgressBar(8), SizedBox(height: isTall ? 40 : 20), - common.buildTextMd( - "Et voilà votre code secret !\n\nMémorisez-le ou notez-le, car il vous sera demandé **à chaque fois** que vous voudrez effectuer un paiement sur cet appareil."), + common.buildText( + "Et voilà votre code secret !\n\nMémorisez-le ou notez-le, car il vous sera demandé **à chaque fois** que vous voudrez effectuer un paiement sur cet appareil.", + 20, + true), const SizedBox(height: 100), Stack( alignment: Alignment.centerRight,