| 1 | import 'package:cake_wallet/generated/i18n.dart'; |
| 2 | import 'package:cake_wallet/src/widgets/cake_image_widget.dart'; |
| 3 | import 'package:cw_core/wallet_info.dart'; |
| 4 | import 'package:flutter/material.dart'; |
| 5 | |
| 6 | class HardwareWalletProceedOnDeviceMessage extends StatelessWidget { |
| 7 | const HardwareWalletProceedOnDeviceMessage({super.key, required this.hardwareWalletType}); |
| 8 | |
| 9 | final HardwareWalletType hardwareWalletType; |
| 10 | |
| 11 | @override |
| 12 | Widget build(BuildContext context) { |
| 13 | return Container( |
| 14 | width: double.infinity, |
| 15 | decoration: BoxDecoration( |
| 16 | border: Border.all( |
| 17 | color: Theme.of(context).colorScheme.primary, |
| 18 | ), |
| 19 | borderRadius: BorderRadius.circular(16), |
| 20 | ), |
| 21 | child: Padding( |
| 22 | padding: const EdgeInsets.all(12.0), |
| 23 | child: Column(spacing: 8, children: [ |
| 24 | if (hardwareWalletIcon != null) |
| 25 | CakeImageWidget( |
| 26 | imageUrl: hardwareWalletIcon!, |
| 27 | width: 36, |
| 28 | height: 36, |
| 29 | colorFilter: ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn), |
| 30 | ), |
| 31 | Text( |
| 32 | S.of(context).proceed_on_device, |
| 33 | style: TextStyle( |
| 34 | fontSize: 16, |
| 35 | fontWeight: FontWeight.w400, |
| 36 | color: Theme.of(context).colorScheme.onSurface, |
| 37 | ), |
| 38 | ) |
| 39 | ]), |
| 40 | ), |
| 41 | ); |
| 42 | } |
| 43 | |
| 44 | String? get hardwareWalletIcon { |
| 45 | switch (hardwareWalletType) { |
| 46 | case HardwareWalletType.bitbox: |
| 47 | return "assets/new-ui/hardware_wallets/device_bitbox.svg"; |
| 48 | case HardwareWalletType.ledger: |
| 49 | return "assets/new-ui/hardware_wallets/device_ledger_nano_x.svg"; |
| 50 | case HardwareWalletType.trezor: |
| 51 | return "assets/new-ui/hardware_wallets/device_trezor_safe_7.svg"; |
| 52 | case HardwareWalletType.cupcake: |
| 53 | return "assets/images/cupcake.svg"; |
| 54 | case HardwareWalletType.coldcard: |
| 55 | case HardwareWalletType.seedsigner: |
| 56 | case HardwareWalletType.keystone: |
| 57 | return "assets/images/hardware_wallet/device_qr.svg"; |
| 58 | } |
| 59 | } |
| 60 | } |