dev
dart 68 lines 3.01 KB
Raw
1 import 'package:cake_wallet/src/screens/yat/widgets/yat_bar.dart';
2 import 'package:cake_wallet/src/screens/yat/widgets/yat_page_indicator.dart';
3 import 'package:cake_wallet/src/widgets/primary_button.dart';
4 import 'package:cake_wallet/src/widgets/scrollable_with_bottom_section.dart';
5 import 'package:flutter/material.dart';
6 import 'package:lottie/lottie.dart';
7 import 'package:cake_wallet/generated/i18n.dart';
8
9 class FirstIntroduction extends StatelessWidget {
10 FirstIntroduction({required this.onNext, this.onClose});
11
12 static const aspectRatioImage = 1.133;
13 final VoidCallback? onClose;
14 final VoidCallback onNext;
15 final animation = Lottie.asset('assets/animation/anim1.json');
16
17 @override
18 Widget build(BuildContext context) {
19 final screenHeight = MediaQuery.of(context).size.height;
20 final screenWidth = MediaQuery.of(context).size.width;
21
22 return Container(
23 height: screenHeight,
24 width: screenWidth,
25 color: Theme.of(context).colorScheme.surfaceContainer,
26 child: ScrollableWithBottomSection(
27 contentPadding: EdgeInsets.only(top: 40, bottom: 40),
28 content: Column(children: [
29 Container(
30 height: 45,
31 padding: EdgeInsets.only(left: 24, right: 24),
32 child: YatBar(onClose: () => Navigator.of(context).pop())),
33 animation,
34 Container(
35 padding: EdgeInsets.only(left: 30, right: 30),
36 child: Column(children: [
37 Text(S.of(context).yat_alert_title,
38 textAlign: TextAlign.center,
39 style: Theme.of(context).textTheme.bodyMedium!.copyWith(
40 fontSize: 24,
41 fontWeight: FontWeight.bold,
42 color: Theme.of(context).colorScheme.onSurface,
43 decoration: TextDecoration.none,
44 )),
45 Padding(
46 padding: EdgeInsets.only(top: 20),
47 child: Text(S.of(context).yat_alert_content,
48 textAlign: TextAlign.center,
49 style: Theme.of(context).textTheme.bodyMedium!.copyWith(
50 fontSize: 16,
51 fontWeight: FontWeight.normal,
52 color: Theme.of(context).colorScheme.onSurface,
53 decoration: TextDecoration.none,
54 )))
55 ]))
56 ]),
57 bottomSectionPadding: EdgeInsets.fromLTRB(24, 0, 24, 24),
58 bottomSection: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
59 PrimaryButton(
60 text: S.of(context).restore_next,
61 textColor: Theme.of(context).colorScheme.onPrimary,
62 color: Theme.of(context).colorScheme.primary,
63 onPressed: onNext),
64 Padding(padding: EdgeInsets.only(top: 24), child: YatPageIndicator(filled: 0))
65 ]),
66 ));
67 }
68 }