factorize isMd text
This commit is contained in:
parent
6f7dd4e413
commit
a4d72d036f
|
@ -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(
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -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),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue