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

99 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/scale_functions.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/widgets/commons/build_text.dart';
import 'package:gecko/widgets/commons/top_appbar.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: GeckoAppBar('allGood'.tr()),
body: SafeArea(
child: Stack(children: [
Column(children: <Widget>[
ScaledSizedBox(height: isTall ? 25 : 5),
BuildText(
text: "yourChestAndWalletWereCreatedSuccessfully".tr()),
ScaledSizedBox(height: isTall ? 15 : 5),
Image.asset(
'assets/onBoarding/gecko-clin.gif',
height: scaleSize(isTall ? 330 : 280),
),
Expanded(
child: Align(
alignment: Alignment.bottomCenter,
child: finishButton(context)),
),
ScaledSizedBox(height: isTall ? 40 : 5),
]),
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 ScaledSizedBox(
width: 340,
height: 55,
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: scaledTextStyle(
fontSize: 21, fontWeight: FontWeight.w600, color: Colors.white),
),
),
);
}