gecko/lib/screens/onBoarding/11_congratulations.dart

104 lines
3.2 KiB
Dart

// ignore_for_file: file_names
import 'dart:math';
import 'package:confetti/confetti.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/widgets/commons/build_text.dart';
class OnboardingStepEleven extends StatelessWidget {
const OnboardingStepEleven({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final conffetiController =
ConfettiController(duration: const Duration(milliseconds: 500));
conffetiController.play();
return PopScope(
canPop: false,
child: Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60,
leading: const Icon(Icons.check),
title: Text(
'allGood'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
),
extendBodyBehindAppBar: true,
body: SafeArea(
child: Stack(children: [
Column(children: <Widget>[
const SizedBox(height: 30),
BuildText(
text: "yourChestAndWalletWereCreatedSuccessfully".tr()),
const SizedBox(height: 15),
Image.asset(
'assets/onBoarding/gecko-clin.gif',
height: 350,
),
Expanded(
child: Align(
alignment: Alignment.bottomCenter,
child: finishButton(context)),
),
const SizedBox(height: 40),
]),
Align(
alignment: Alignment.topLeft,
child: ConfettiWidget(
confettiController: conffetiController,
blastDirection: pi * 0.1,
maxBlastForce: 10,
minBlastForce: 1,
emissionFrequency: 0.01,
numberOfParticles: 7,
shouldLoop: false,
gravity: 0.2,
),
),
Align(
alignment: Alignment.topRight,
child: ConfettiWidget(
confettiController: conffetiController,
blastDirection: pi * 0.9,
maxBlastForce: 10,
minBlastForce: 1,
emissionFrequency: 0.01,
numberOfParticles: 7,
shouldLoop: false,
gravity: 0.2,
),
),
]),
)),
);
}
}
Widget finishButton(BuildContext context) {
return SizedBox(
width: 370,
height: 60,
child: ElevatedButton(
key: keyGoWalletsHome,
style: ElevatedButton.styleFrom(
foregroundColor: Colors.white,
elevation: 4,
backgroundColor: orangeC,
),
onPressed: () {
Navigator.pushNamedAndRemoveUntil(
context, '/mywallets', ModalRoute.withName('/'));
},
child: Text(
"accessMyChest".tr(),
style: const TextStyle(fontSize: 22, fontWeight: FontWeight.w600),
),
),
);
}