2021-11-14 19:21:20 +01:00
|
|
|
// ignore_for_file: file_names
|
2021-03-02 07:05:47 +01:00
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
2021-11-08 23:12:25 +01:00
|
|
|
import 'package:gecko/globals.dart';
|
2021-12-23 15:13:58 +01:00
|
|
|
import 'package:gecko/providers/generate_wallets.dart';
|
2021-11-14 19:21:20 +01:00
|
|
|
import 'package:gecko/screens/common_elements.dart';
|
2021-03-08 06:21:04 +01:00
|
|
|
import 'package:gecko/screens/onBoarding/12.dart';
|
2021-03-02 07:05:47 +01:00
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
// ignore: must_be_immutable
|
|
|
|
class OnboardingStepThirteen extends StatelessWidget {
|
2021-03-08 01:08:26 +01:00
|
|
|
final int progress = 10;
|
2021-03-02 07:05:47 +01:00
|
|
|
|
2021-12-23 12:36:09 +01:00
|
|
|
const OnboardingStepThirteen({Key? key}) : super(key: key);
|
2021-11-14 19:21:20 +01:00
|
|
|
|
2021-03-02 07:05:47 +01:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
|
|
|
GenerateWalletsProvider _generateWalletProvider =
|
|
|
|
Provider.of<GenerateWalletsProvider>(context);
|
2021-03-02 08:19:20 +01:00
|
|
|
// MyWalletsProvider myWalletProvider =
|
|
|
|
// Provider.of<MyWalletsProvider>(context);
|
2021-03-02 07:05:47 +01:00
|
|
|
CommonElements common = CommonElements();
|
2021-12-19 21:05:04 +01:00
|
|
|
_generateWalletProvider.pin.text =
|
|
|
|
_generateWalletProvider.changePinCode(reload: false);
|
2021-03-02 07:05:47 +01:00
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
extendBodyBehindAppBar: true,
|
|
|
|
body: SafeArea(
|
|
|
|
child: Column(children: <Widget>[
|
2021-03-08 17:23:56 +01:00
|
|
|
common.onboardingProgressBar(
|
|
|
|
context, 'Ma phrase de restauration', progress),
|
2021-04-24 20:27:18 +02:00
|
|
|
common.bubbleSpeakRich(
|
|
|
|
<TextSpan>[
|
2021-11-14 19:21:20 +01:00
|
|
|
const TextSpan(
|
2021-04-24 20:27:18 +02:00
|
|
|
text:
|
|
|
|
"Et voilà votre code secret !\n\nMémorisez-le ou notez-le, car il vous sera demandé "),
|
2021-11-14 19:21:20 +01:00
|
|
|
const TextSpan(
|
2021-04-24 20:27:18 +02:00
|
|
|
text: 'à chaque fois',
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold)),
|
2021-11-14 19:21:20 +01:00
|
|
|
const TextSpan(
|
2021-04-24 20:27:18 +02:00
|
|
|
text:
|
|
|
|
" que vous voudrez effectuer un paiement sur cet appareil."),
|
|
|
|
],
|
2021-11-14 19:21:20 +01:00
|
|
|
textKey: const Key('step11'),
|
2021-04-24 20:27:18 +02:00
|
|
|
),
|
2021-11-14 19:21:20 +01:00
|
|
|
const SizedBox(height: 100),
|
|
|
|
Stack(
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
children: <Widget>[
|
|
|
|
TextField(
|
|
|
|
key: const Key('generatedPin'),
|
|
|
|
enabled: false,
|
|
|
|
controller: _generateWalletProvider.pin,
|
|
|
|
maxLines: 1,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
decoration: const InputDecoration(),
|
|
|
|
style: const TextStyle(
|
|
|
|
letterSpacing: 5,
|
|
|
|
fontSize: 35.0,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold)),
|
|
|
|
IconButton(
|
|
|
|
icon: const Icon(Icons.replay),
|
|
|
|
color: orangeC,
|
2021-12-19 21:05:04 +01:00
|
|
|
onPressed: () {
|
|
|
|
_generateWalletProvider.changePinCode(reload: true);
|
2021-11-14 19:21:20 +01:00
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
2021-03-02 07:05:47 +01:00
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
child: SizedBox(
|
|
|
|
width: 400,
|
|
|
|
height: 62,
|
|
|
|
child: ElevatedButton(
|
2021-11-14 19:21:20 +01:00
|
|
|
key: const Key('changeSecretCode'),
|
2021-03-02 07:05:47 +01:00
|
|
|
style: ElevatedButton.styleFrom(
|
|
|
|
elevation: 5,
|
2021-11-14 19:21:20 +01:00
|
|
|
primary: const Color(0xffFFD58D),
|
2021-03-02 07:05:47 +01:00
|
|
|
onPrimary: Colors.black, // foreground
|
|
|
|
),
|
2021-12-19 21:05:04 +01:00
|
|
|
onPressed: () {
|
|
|
|
_generateWalletProvider.changePinCode(reload: true);
|
2021-03-02 07:05:47 +01:00
|
|
|
},
|
2021-11-14 19:21:20 +01:00
|
|
|
child: const Text("Choisir un autre code secret",
|
2021-03-02 07:05:47 +01:00
|
|
|
style: TextStyle(fontSize: 20))),
|
|
|
|
))),
|
2021-11-14 19:21:20 +01:00
|
|
|
const SizedBox(height: 25),
|
2021-03-02 07:05:47 +01:00
|
|
|
SizedBox(
|
|
|
|
width: 400,
|
|
|
|
height: 62,
|
|
|
|
child: ElevatedButton(
|
2021-11-14 19:21:20 +01:00
|
|
|
key: const Key('goStep12'),
|
2021-03-02 07:05:47 +01:00
|
|
|
style: ElevatedButton.styleFrom(
|
|
|
|
elevation: 5,
|
2021-11-08 23:12:25 +01:00
|
|
|
primary: orangeC,
|
2021-03-02 07:05:47 +01:00
|
|
|
onPrimary: Colors.white, // foreground
|
|
|
|
),
|
|
|
|
onPressed: () async {
|
|
|
|
_generateWalletProvider.isAskedWordValid = false;
|
|
|
|
_generateWalletProvider.askedWordColor = Colors.black;
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
2021-03-08 06:21:04 +01:00
|
|
|
FaderTransition(
|
2021-12-19 21:05:04 +01:00
|
|
|
page: OnboardingStepFourteen(), isFast: true),
|
2021-03-02 07:05:47 +01:00
|
|
|
);
|
|
|
|
},
|
2021-11-14 19:21:20 +01:00
|
|
|
child: const Text("J'ai noté mon code secret",
|
2021-03-02 07:05:47 +01:00
|
|
|
style: TextStyle(fontSize: 20))),
|
|
|
|
),
|
2021-11-14 19:21:20 +01:00
|
|
|
const SizedBox(height: 80),
|
2021-03-02 07:05:47 +01:00
|
|
|
]),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|