dev
dart 114 lines 4.43 KB
Raw
1 import 'package:cake_wallet/core/new_wallet_arguments.dart';
2 import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
3 import 'package:cake_wallet/src/widgets/gradient_background.dart';
4 import 'package:cake_wallet/src/widgets/primary_button.dart';
5 import 'package:cw_core/wallet_type.dart';
6 import 'package:flutter/material.dart';
7 import 'package:cake_wallet/generated/i18n.dart';
8 import 'package:cake_wallet/routes.dart';
9 import 'package:cake_wallet/src/screens/base_page.dart';
10
11 class WalletGroupDescriptionPage extends BasePage {
12 WalletGroupDescriptionPage({required this.selectedWalletType});
13
14 final WalletType selectedWalletType;
15
16 @override
17 bool get gradientBackground => true;
18
19 @override
20 Widget Function(BuildContext, Widget) get rootWrapper =>
21 (BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold);
22
23 @override
24 String get title => S.current.wallet_list_create_new_wallet;
25
26 @override
27 Widget body(BuildContext context) {
28 return Container(
29 alignment: Alignment.center,
30 padding: EdgeInsets.symmetric(horizontal: 20),
31 child: Column(
32 children: [
33 SizedBox(height: 48),
34 CakeImageWidget(
35 imageUrl: currentTheme.isDark
36 ? 'assets/new-ui/hero/wallet_group_options_dark.svg'
37 : 'assets/new-ui/hero/wallet_group_options_light.svg',
38 height: 200,
39 ),
40 SizedBox(height: 40),
41 Expanded(
42 child: Scrollbar(
43 child: SingleChildScrollView(
44 child: Text.rich(
45 TextSpan(
46 children: [
47 TextSpan(text: '${S.of(context).wallet_group_description_one} '),
48 TextSpan(
49 text: '${S.of(context).wallet_group.toLowerCase()} ',
50 style: Theme.of(context)
51 .textTheme
52 .bodyMedium!
53 .copyWith(fontWeight: FontWeight.w700),
54 ),
55 TextSpan(
56 text: '${S.of(context).wallet_group_description_two} ',
57 ),
58 TextSpan(
59 text: '${S.of(context).choose_wallet_group} ',
60 style: Theme.of(context)
61 .textTheme
62 .bodyMedium!
63 .copyWith(fontWeight: FontWeight.w700),
64 ),
65 TextSpan(
66 text: '${S.of(context).wallet_group_description_three} ',
67 ),
68 TextSpan(
69 text: '${S.of(context).create_new_seed} ',
70 style: Theme.of(context)
71 .textTheme
72 .bodyMedium!
73 .copyWith(fontWeight: FontWeight.w700),
74 ),
75 TextSpan(text: S.of(context).wallet_group_description_four),
76 ],
77 ),
78 textAlign: TextAlign.center,
79 style: Theme.of(context).textTheme.bodyMedium!.copyWith(
80 height: 1.5,
81 fontSize: 16,
82 color: Theme.of(context).colorScheme.onSurfaceVariant,
83 ),
84 ),
85 ),
86 ),
87 ),
88 PrimaryButton(
89 key: ValueKey('wallet_group_description_page_create_new_seed_button_key'),
90 onPressed: () => Navigator.of(context).pushNamed(
91 Routes.newWallet,
92 arguments: NewWalletArguments(type: selectedWalletType),
93 ),
94 text: S.of(context).create_new_seed,
95 color: Theme.of(context).colorScheme.surfaceContainer,
96 textColor: Theme.of(context).colorScheme.onSecondaryContainer,
97 ),
98 SizedBox(height: 12),
99 PrimaryButton(
100 key: ValueKey('wallet_group_description_page_choose_wallet_group_button_key'),
101 onPressed: () => Navigator.of(context).pushNamed(
102 Routes.walletGroupsDisplayPage,
103 arguments: selectedWalletType,
104 ),
105 text: S.of(context).choose_wallet_group,
106 color: Theme.of(context).colorScheme.primary,
107 textColor: Theme.of(context).colorScheme.onPrimary,
108 ),
109 SizedBox(height: 24),
110 ],
111 ),
112 );
113 }
114 }