| 1 | import 'package:cake_wallet/generated/i18n.dart'; |
| 2 | import 'package:cake_wallet/new-ui/widgets/animated_dropdown.dart'; |
| 3 | import 'package:cake_wallet/new-ui/widgets/new_primary_button.dart'; |
| 4 | import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart'; |
| 5 | import 'package:cake_wallet/src/widgets/cake_image_widget.dart'; |
| 6 | import 'package:cw_core/currency_for_wallet_type.dart'; |
| 7 | import 'package:cw_core/wallet_type.dart'; |
| 8 | import 'package:flutter/material.dart'; |
| 9 | |
| 10 | class WalletDeprecationPopup extends StatelessWidget { |
| 11 | const WalletDeprecationPopup({super.key, required this.type, this.seed}); |
| 12 | |
| 13 | final WalletType type; |
| 14 | final String? seed; |
| 15 | |
| 16 | @override |
| 17 | Widget build(BuildContext context) { |
| 18 | final curr = walletTypeToCryptoCurrency(type); |
| 19 | |
| 20 | return Container( |
| 21 | decoration: BoxDecoration( |
| 22 | borderRadius: BorderRadius.vertical(top: Radius.circular(20)), |
| 23 | color: Theme.of(context).colorScheme.surface), |
| 24 | child: SafeArea( |
| 25 | child: Column( |
| 26 | mainAxisSize: MainAxisSize.min, |
| 27 | children: [ |
| 28 | ModalTopBar( |
| 29 | title: "", |
| 30 | leadingIcon: Icon(Icons.close), |
| 31 | leadingSemanticLabel: S.of(context).close, |
| 32 | onLeadingPressed: Navigator.of(context).pop, |
| 33 | ), |
| 34 | Padding( |
| 35 | padding: const EdgeInsets.symmetric(horizontal: 12.0), |
| 36 | child: Column( |
| 37 | spacing: 24, |
| 38 | children: [ |
| 39 | CakeImageWidget( |
| 40 | imageUrl: curr.iconPath, |
| 41 | width: 64, |
| 42 | height: 64, |
| 43 | ), |
| 44 | Text( |
| 45 | "${curr.fullName} is no longer supported", |
| 46 | style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600), |
| 47 | textAlign: TextAlign.center, |
| 48 | ), |
| 49 | Text( |
| 50 | "Apologies for the inconvenience.", |
| 51 | textAlign: TextAlign.center, |
| 52 | ), |
| 53 | if (seed != null) ...[ |
| 54 | Text( |
| 55 | "If you need to migrate your seed, you can see it below.", |
| 56 | textAlign: TextAlign.center, |
| 57 | ), |
| 58 | AnimatedDropdown(content: Text(seed!), dropdownText: "Tap to show seed"), |
| 59 | ], |
| 60 | NewPrimaryButton( |
| 61 | onPressed: Navigator.of(context).pop, |
| 62 | text: "Close", |
| 63 | color: Theme.of(context).colorScheme.primary, |
| 64 | textColor: Theme.of(context).colorScheme.onPrimary), |
| 65 | SizedBox() |
| 66 | ], |
| 67 | ), |
| 68 | ) |
| 69 | ], |
| 70 | ), |
| 71 | ), |
| 72 | ); |
| 73 | } |
| 74 | } |