| 1 | import 'package:cake_wallet/generated/i18n.dart'; |
| 2 | import 'package:cake_wallet/routes.dart'; |
| 3 | import 'package:cake_wallet/src/widgets/cake_image_widget.dart'; |
| 4 | import 'package:cake_wallet/src/widgets/primary_button.dart'; |
| 5 | import 'package:cake_wallet/themes/core/material_base_theme.dart'; |
| 6 | import 'package:cw_core/wallet_type.dart'; |
| 7 | import 'package:flutter/material.dart'; |
| 8 | |
| 9 | class SeedVerificationSuccessView extends StatelessWidget { |
| 10 | const SeedVerificationSuccessView( |
| 11 | {required this.currentTheme, super.key, required this.walletType}); |
| 12 | |
| 13 | final MaterialThemeBase currentTheme; |
| 14 | final WalletType walletType; |
| 15 | |
| 16 | @override |
| 17 | Widget build(BuildContext context) { |
| 18 | return Center( |
| 19 | child: Column( |
| 20 | crossAxisAlignment: CrossAxisAlignment.center, |
| 21 | children: [ |
| 22 | ConstrainedBox( |
| 23 | constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.3), |
| 24 | child: CakeImageWidget( |
| 25 | height: 128, |
| 26 | imageUrl: currentTheme.isDark |
| 27 | ? 'assets/images/seed_verified_dark.png' |
| 28 | : 'assets/images/seed_verified_light.png', |
| 29 | ), |
| 30 | ), |
| 31 | SizedBox(height: 40), |
| 32 | Text( |
| 33 | S.current.seed_verified, |
| 34 | textAlign: TextAlign.center, |
| 35 | style: Theme.of(context).textTheme.bodyLarge?.copyWith( |
| 36 | color: Theme.of(context).colorScheme.onSurface, |
| 37 | fontSize: 20, |
| 38 | fontWeight: FontWeight.w600, |
| 39 | ), |
| 40 | ), |
| 41 | SizedBox(height: 48), |
| 42 | RichText( |
| 43 | text: TextSpan( |
| 44 | children: [ |
| 45 | TextSpan( |
| 46 | text: '${S.current.seed_verified_subtext} ', |
| 47 | style: Theme.of(context).textTheme.bodyMedium?.copyWith( |
| 48 | fontWeight: FontWeight.w500, |
| 49 | color: Theme.of(context).colorScheme.onSurfaceVariant, |
| 50 | fontSize: 16, |
| 51 | ), |
| 52 | ), |
| 53 | TextSpan( |
| 54 | text: S.current.seed_display_path, |
| 55 | style: Theme.of(context).textTheme.bodyLarge?.copyWith( |
| 56 | color: Theme.of(context).colorScheme.onSurfaceVariant, |
| 57 | fontWeight: FontWeight.w700, |
| 58 | fontSize: 16, |
| 59 | ), |
| 60 | ), |
| 61 | ], |
| 62 | ), |
| 63 | textAlign: TextAlign.center, |
| 64 | ), |
| 65 | Spacer(), |
| 66 | PrimaryButton( |
| 67 | key: ValueKey('wallet_seed_page_open_wallet_button_key'), |
| 68 | onPressed: () { |
| 69 | if (walletType == WalletType.bitcoin) { |
| 70 | Navigator.of(context).pushNamed(Routes.lightningUsernamePage, arguments: true); |
| 71 | } else { |
| 72 | Navigator.of(context).popUntil((route) => route.isFirst); |
| 73 | } |
| 74 | }, |
| 75 | text: (walletType == WalletType.bitcoin) |
| 76 | ? S.current.continue_text |
| 77 | : S.current.open_wallet, |
| 78 | color: Theme.of(context).colorScheme.primary, |
| 79 | textColor: Theme.of(context).colorScheme.onPrimary, |
| 80 | ), |
| 81 | SizedBox(height: 16), |
| 82 | ], |
| 83 | ), |
| 84 | ); |
| 85 | } |
| 86 | } |