2022-05-23 10:53:44 +02:00
|
|
|
// ignore_for_file: file_names
|
|
|
|
|
2023-03-15 19:40:42 +01:00
|
|
|
import 'dart:math';
|
|
|
|
|
|
|
|
import 'package:confetti/confetti.dart';
|
2022-06-17 01:13:14 +02:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2022-11-30 05:22:37 +01:00
|
|
|
|
2022-05-23 10:53:44 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:gecko/globals.dart';
|
2022-08-23 00:25:16 +02:00
|
|
|
import 'package:gecko/models/widgets_keys.dart';
|
2022-12-10 08:16:38 +01:00
|
|
|
import 'package:gecko/widgets/commons/build_text.dart';
|
2022-05-23 10:53:44 +02:00
|
|
|
|
2022-05-25 20:40:25 +02:00
|
|
|
class OnboardingStepEleven extends StatelessWidget {
|
|
|
|
const OnboardingStepEleven({Key? key}) : super(key: key);
|
2022-05-23 10:53:44 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-03-15 19:40:42 +01:00
|
|
|
final conffetiController =
|
|
|
|
ConfettiController(duration: const Duration(milliseconds: 300));
|
|
|
|
conffetiController.play();
|
|
|
|
return WillPopScope(
|
|
|
|
onWillPop: () {
|
|
|
|
return Future<bool>.value(false);
|
|
|
|
},
|
|
|
|
child: Scaffold(
|
|
|
|
backgroundColor: backgroundColor,
|
|
|
|
appBar: AppBar(
|
|
|
|
toolbarHeight: 60 * ratio,
|
|
|
|
leading: const Icon(Icons.check),
|
|
|
|
title: SizedBox(
|
|
|
|
height: 22,
|
|
|
|
child: Text(
|
|
|
|
'allGood'.tr(),
|
|
|
|
style: const TextStyle(fontWeight: FontWeight.w600),
|
|
|
|
),
|
2022-05-23 10:53:44 +02:00
|
|
|
),
|
|
|
|
),
|
2023-03-15 19:40:42 +01:00
|
|
|
extendBodyBehindAppBar: true,
|
|
|
|
body: SafeArea(
|
|
|
|
child: Stack(children: [
|
|
|
|
Column(children: <Widget>[
|
|
|
|
const SizedBox(height: 40),
|
|
|
|
BuildText(
|
|
|
|
text: "yourChestAndWalletWereCreatedSuccessfully".tr()),
|
|
|
|
SizedBox(height: isTall ? 20 : 10),
|
|
|
|
Image.asset(
|
|
|
|
'assets/onBoarding/gecko-clin.gif',
|
|
|
|
height: isTall ? 400 : 300,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
child: finishButton(context)),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 40),
|
|
|
|
]),
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
child: ConfettiWidget(
|
|
|
|
confettiController: conffetiController,
|
|
|
|
blastDirection: pi / 2,
|
|
|
|
maxBlastForce: 5,
|
|
|
|
minBlastForce: 1,
|
|
|
|
emissionFrequency: 0.01,
|
|
|
|
numberOfParticles: 10,
|
|
|
|
shouldLoop: false,
|
|
|
|
gravity: 0.1,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
)),
|
|
|
|
);
|
2022-05-23 10:53:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget finishButton(BuildContext context) {
|
|
|
|
return SizedBox(
|
2022-05-25 20:40:25 +02:00
|
|
|
width: 380 * ratio,
|
|
|
|
height: 60 * ratio,
|
2022-05-23 10:53:44 +02:00
|
|
|
child: ElevatedButton(
|
2022-08-23 00:25:16 +02:00
|
|
|
key: keyGoWalletsHome,
|
2022-05-23 10:53:44 +02:00
|
|
|
style: ElevatedButton.styleFrom(
|
2022-09-05 08:09:12 +02:00
|
|
|
foregroundColor: Colors.white, elevation: 4,
|
|
|
|
backgroundColor: orangeC, // foreground
|
2022-05-23 10:53:44 +02:00
|
|
|
),
|
|
|
|
onPressed: () {
|
2022-12-02 21:18:28 +01:00
|
|
|
Navigator.pushNamedAndRemoveUntil(
|
2022-12-04 23:17:46 +01:00
|
|
|
context, '/mywallets', ModalRoute.withName('/'));
|
2022-05-23 10:53:44 +02:00
|
|
|
},
|
2022-06-17 01:13:14 +02:00
|
|
|
child: Text("accessMyChest".tr(),
|
2022-05-25 20:40:25 +02:00
|
|
|
style:
|
|
|
|
TextStyle(fontSize: 22 * ratio, fontWeight: FontWeight.w600))),
|
2022-05-23 10:53:44 +02:00
|
|
|
);
|
|
|
|
}
|