Add global variable for responsive ratio in app; Fix all paddings for OnBoarding screens; Considere pinlenght in creation
This commit is contained in:
parent
5e53977508
commit
43a145821d
|
@ -7,3 +7,7 @@ String appVersion;
|
|||
SharedPreferences prefs;
|
||||
String endPointGVA;
|
||||
int ramSys;
|
||||
|
||||
// Responsive ratios
|
||||
bool isTall;
|
||||
double ratio;
|
||||
|
|
|
@ -105,9 +105,14 @@ class WalletOptionsProvider with ChangeNotifier {
|
|||
}
|
||||
|
||||
int getPinLenght(_walletNbr) {
|
||||
File _walletFile =
|
||||
File('${walletsDirectory.path}/$_walletNbr/wallet.dewif');
|
||||
String _localDewif = _walletFile.readAsStringSync();
|
||||
String _localDewif;
|
||||
if (_walletNbr is int) {
|
||||
File _walletFile =
|
||||
File('${walletsDirectory.path}/$_walletNbr/wallet.dewif');
|
||||
_localDewif = _walletFile.readAsStringSync();
|
||||
} else {
|
||||
_localDewif = _walletNbr;
|
||||
}
|
||||
|
||||
final int _pinLenght = DubpRust.getDewifSecretCodeLen(
|
||||
dewif: _localDewif, secretCodeType: SecretCodeType.letters);
|
||||
|
|
|
@ -21,6 +21,13 @@ class HomeScreen extends StatelessWidget {
|
|||
MyWalletsProvider _myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context);
|
||||
final bool isWalletsExists = _myWalletProvider.checkIfWalletExist();
|
||||
|
||||
isTall = false;
|
||||
ratio = 1;
|
||||
if (MediaQuery.of(context).size.height >= 930) {
|
||||
isTall = true;
|
||||
ratio = 1.125;
|
||||
}
|
||||
// CommonElements commonElements = CommonElements();
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'dart:ui';
|
|||
import 'package:dubp/dubp.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
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';
|
||||
|
@ -39,6 +40,7 @@ class OnboardingStepTen extends StatelessWidget {
|
|||
return Future<bool>.value(true);
|
||||
},
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
extendBodyBehindAppBar: true,
|
||||
body: SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
|
@ -47,19 +49,68 @@ class OnboardingStepTen extends StatelessWidget {
|
|||
common.bubbleSpeakRich(<TextSpan>[
|
||||
TextSpan(
|
||||
text:
|
||||
"Avez-vous bien noté votre phrase de restauration ?\n\nPour en être sûr, veuillez taper dans le champ ci-dessous le "),
|
||||
"Avez-vous bien noté votre phrase de restauration ?\n\nPour en être sûr, veuillez taper dans le champ ci-dessous le ",
|
||||
style: TextStyle(fontSize: 16 * ratio)),
|
||||
TextSpan(
|
||||
text: '${_generateWalletProvider.nbrWord + 1}ème mot',
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
TextSpan(text: " de votre phrase de restauration :"),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16 * ratio)),
|
||||
TextSpan(
|
||||
text: " de votre phrase de restauration :",
|
||||
style: TextStyle(fontSize: 16 * ratio)),
|
||||
]),
|
||||
SizedBox(height: 70),
|
||||
Text('${_generateWalletProvider.nbrWord + 1}',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: Color(0xffD28928),
|
||||
fontWeight: FontWeight.w400)),
|
||||
SizedBox(height: 7),
|
||||
|
||||
// LayoutBuilder(builder: (builder, constraints) {
|
||||
// // 2
|
||||
// var hasDetailPage = constraints.maxWidth > 480;
|
||||
|
||||
// if (hasDetailPage) {
|
||||
// // 3
|
||||
// return Row(
|
||||
// children: [
|
||||
// // 4
|
||||
// SizedBox(
|
||||
// width: 250,
|
||||
// height: 500,
|
||||
// child: Text('GRAND'),
|
||||
// ),
|
||||
// // 5
|
||||
// Expanded(
|
||||
// child: Text('GRAND 2'),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// } else {
|
||||
// // 6
|
||||
// return Text('PETIT');
|
||||
// }
|
||||
// }),
|
||||
|
||||
// Expanded(
|
||||
// child:
|
||||
// //ScreenTypeLayout with custom breakpoints supplied
|
||||
// ScreenTypeLayout(
|
||||
// breakpoints: ScreenBreakpoints(
|
||||
// tablet: 600,
|
||||
// desktop: 950,
|
||||
// watch: 480,
|
||||
// ),
|
||||
// mobile: Container(color: Colors.blue),
|
||||
// tablet: Container(color: Colors.yellow),
|
||||
// desktop: Container(color: Colors.red),
|
||||
// watch: Container(color: Colors.purple),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
SizedBox(height: isTall ? 70 : 10),
|
||||
if (isTall)
|
||||
Text('${_generateWalletProvider.nbrWord + 1}',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: Color(0xffD28928),
|
||||
fontWeight: FontWeight.w400)),
|
||||
SizedBox(height: isTall ? 10 : 0),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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';
|
||||
|
||||
|
@ -27,10 +28,10 @@ class OnboardingStepEleven extends StatelessWidget {
|
|||
text:
|
||||
" \n\nVotre code secret chiffre votre trousseau de clefs, ce qui le rend inutilisable par d’autres, par exemple si vous perdez votre téléphone ou si on vous le vole."),
|
||||
]),
|
||||
SizedBox(height: 10),
|
||||
SizedBox(height: isTall ? 50 : 10),
|
||||
Image.asset(
|
||||
'assets/onBoarding/treasure-chest-gecko-souligne.png',
|
||||
height: 400,
|
||||
height: 280 * ratio, //5": 400
|
||||
),
|
||||
Expanded(
|
||||
child: Align(
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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';
|
||||
|
||||
|
@ -12,7 +13,7 @@ class OnboardingStepTwelve extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
CommonElements common = CommonElements();
|
||||
|
||||
|
||||
return Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
body: SafeArea(
|
||||
|
@ -23,7 +24,7 @@ class OnboardingStepTwelve extends StatelessWidget {
|
|||
SizedBox(height: 10),
|
||||
Image.asset(
|
||||
'assets/onBoarding/plusieurs-codes-secrets-un-trousseau.png',
|
||||
height: 470,
|
||||
height: 410 * ratio,
|
||||
),
|
||||
Expanded(
|
||||
child: Align(
|
||||
|
@ -46,7 +47,7 @@ class OnboardingStepTwelve extends StatelessWidget {
|
|||
child: Text("Générer le code secret",
|
||||
style: TextStyle(fontSize: 20))),
|
||||
))),
|
||||
SizedBox(height: 80),
|
||||
SizedBox(height: isTall ? 80 : 40),
|
||||
]),
|
||||
));
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'dart:ui';
|
|||
import 'package:dubp/dubp.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/generateWallets.dart';
|
||||
import 'package:gecko/models/myWallets.dart';
|
||||
import 'package:gecko/models/walletOptions.dart';
|
||||
|
@ -32,6 +33,7 @@ class OnboardingStepFourteen extends StatelessWidget {
|
|||
WalletOptionsProvider _walletOptions =
|
||||
Provider.of<WalletOptionsProvider>(context);
|
||||
CommonElements common = CommonElements();
|
||||
final int _pinLenght = _walletOptions.getPinLenght(generatedWallet.dewif);
|
||||
|
||||
return Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
|
@ -40,8 +42,8 @@ class OnboardingStepFourteen extends StatelessWidget {
|
|||
common.onboardingProgressBar('Ma phrase de restauration', progress),
|
||||
common.bubbleSpeak(
|
||||
"Avez-vous bien mémorisé votre code secret ?\n\nVérifions ça ensemble !\n\nTapez votre code secret dans le champ ci-dessous (après c’est fini, promis-juré-gecko)."),
|
||||
SizedBox(height: 80),
|
||||
pinForm(context, _walletOptions, 5, 1, 3)
|
||||
SizedBox(height: isTall ? 80 : 10),
|
||||
pinForm(context, _walletOptions, _pinLenght, 1, 3)
|
||||
]),
|
||||
));
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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/myWallets/walletsHome.dart';
|
||||
|
||||
|
@ -21,10 +22,10 @@ class OnboardingStepFiveteen extends StatelessWidget {
|
|||
common.bubbleSpeak(
|
||||
"Top !\n\nVotre trousseau de clef et votre portefeuille ont été créés avec un immense succès.\n\nFélicitations !",
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
SizedBox(height: isTall ? 20 : 10),
|
||||
Image.asset(
|
||||
'assets/onBoarding/gecko-clin.gif',
|
||||
height: 300,
|
||||
height: isTall ? 400 : 300,
|
||||
),
|
||||
Expanded(
|
||||
child: Align(
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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';
|
||||
|
||||
|
@ -21,14 +22,14 @@ class OnboardingStepFor extends StatelessWidget {
|
|||
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),
|
||||
SizedBox(height: isTall ? 15 : 0),
|
||||
// Row(children: <Widget>[
|
||||
// Align(
|
||||
// alignment: Alignment.centerRight,
|
||||
// child:
|
||||
Image.asset(
|
||||
'assets/onBoarding/plusieurs-appareils-un-trousseau.png',
|
||||
height: 350,
|
||||
height: 400 * ratio,
|
||||
),
|
||||
// ]),
|
||||
Expanded(
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
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/6_stepSix.dart';
|
||||
import 'package:gecko/screens/onBoarding/7_stepSeven.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class OnboardingStepFive extends StatelessWidget {
|
||||
|
@ -21,10 +22,10 @@ class OnboardingStepFive extends StatelessWidget {
|
|||
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),
|
||||
SizedBox(height: isTall ? 30 : 10),
|
||||
Image.asset(
|
||||
'assets/onBoarding/maison-qui-brule.png',
|
||||
height: 200,
|
||||
width: 320 * ratio,
|
||||
),
|
||||
Expanded(
|
||||
child: Align(
|
||||
|
@ -41,7 +42,7 @@ class OnboardingStepFive extends StatelessWidget {
|
|||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
SmoothTransition(page: OnboardingStepSix()),
|
||||
SmoothTransition(page: OnboardingStepSeven()),
|
||||
);
|
||||
},
|
||||
child: Text("J'ai compris",
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
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]);
|
||||
CommonElements common = CommonElements();
|
||||
|
||||
return Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
body: SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
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),
|
||||
Image.asset(
|
||||
'assets/onBoarding/good-bad-passphrase.png',
|
||||
height: 300,
|
||||
),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: SizedBox(
|
||||
width: 400,
|
||||
height: 62,
|
||||
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),
|
||||
]),
|
||||
));
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
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';
|
||||
|
||||
|
@ -45,10 +46,10 @@ class OnboardingStepSeven extends StatelessWidget {
|
|||
),
|
||||
]),
|
||||
)),
|
||||
SizedBox(height: 50),
|
||||
SizedBox(height: isTall ? 120 : 50),
|
||||
SizedBox(
|
||||
width: 400,
|
||||
height: 62,
|
||||
height: 62,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 5,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:ui';
|
||||
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';
|
||||
|
||||
|
@ -22,7 +23,8 @@ class OnboardingStepEight extends StatelessWidget {
|
|||
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: 30),
|
||||
SizedBox(height: isTall ? 61 : 31),
|
||||
// SizedBox(height: 30),
|
||||
sentanceArray(context),
|
||||
// ),
|
||||
Expanded(
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/services.dart';
|
||||
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';
|
||||
|
@ -29,9 +30,9 @@ class OnboardingStepNine extends StatelessWidget {
|
|||
"C’est le moment de noter votre phrase !",
|
||||
long: 60,
|
||||
),
|
||||
SizedBox(height: 69),
|
||||
SizedBox(height: isTall ? 100 : 70),
|
||||
sentanceArray(context),
|
||||
SizedBox(height: 15),
|
||||
SizedBox(height: isTall ? 20 : 15),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
|
|
|
@ -590,6 +590,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.21"
|
||||
responsive_builder:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: responsive_builder
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.0"
|
||||
responsive_framework:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
@ -39,8 +39,9 @@ dependencies:
|
|||
sentry_flutter: ^4.0.4
|
||||
catcher: ^0.4.1
|
||||
bubble: ^1.1.9+1
|
||||
responsive_framework: ^0.0.14
|
||||
flutter_svg: ^0.19.1
|
||||
responsive_framework: ^0.0.14
|
||||
responsive_builder: ^0.3.0
|
||||
|
||||
flutter_icons:
|
||||
android: "ic_launcher"
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
flutter run -d all
|
||||
|
||||
|
Loading…
Reference in New Issue