| 1 | import 'package:cake_wallet/src/widgets/cake_image_widget.dart'; |
| 2 | import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart'; |
| 3 | import 'package:cw_core/wallet_type.dart'; |
| 4 | import 'package:flutter/material.dart'; |
| 5 | import 'package:flutter_mobx/flutter_mobx.dart'; |
| 6 | import 'package:flutter_svg/flutter_svg.dart'; |
| 7 | |
| 8 | class ReceiveTokenDisplay extends StatelessWidget { |
| 9 | const ReceiveTokenDisplay({super.key, required this.addressListViewModel}); |
| 10 | |
| 11 | final WalletAddressListViewModel addressListViewModel; |
| 12 | |
| 13 | @override |
| 14 | Widget build(BuildContext context) { |
| 15 | return Observer( |
| 16 | builder: (_) => Row( |
| 17 | mainAxisAlignment: MainAxisAlignment.center, |
| 18 | spacing: 8, |
| 19 | children: [ |
| 20 | Text( |
| 21 | addressListViewModel.tokenCurrency!.title, |
| 22 | style: TextStyle( |
| 23 | fontSize: 18, |
| 24 | fontWeight: FontWeight.w600, |
| 25 | color: Theme.of(context).colorScheme.primary), |
| 26 | ), |
| 27 | Container( |
| 28 | decoration: BoxDecoration( |
| 29 | borderRadius: BorderRadius.circular(99999), |
| 30 | color: Theme.of(context).colorScheme.surfaceContainer), |
| 31 | child: Padding( |
| 32 | padding: const EdgeInsets.all(4.0), |
| 33 | child: Row( |
| 34 | spacing: 4, |
| 35 | children: [ |
| 36 | CakeImageWidget( |
| 37 | imageUrl: |
| 38 | "assets/new-ui/chain_badges/${addressListViewModel.wallet.type == WalletType.bsc ? 'bnb' : walletTypeToString(addressListViewModel.wallet.type).toLowerCase()}.svg", |
| 39 | width: 16, |
| 40 | height: 16, |
| 41 | colorFilter: |
| 42 | ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn), |
| 43 | ), |
| 44 | Text(walletTypeToString(addressListViewModel.wallet.type), |
| 45 | style: TextStyle( |
| 46 | fontSize: 12, |
| 47 | fontWeight: FontWeight.w500, |
| 48 | color: Theme.of(context).colorScheme.primary)), |
| 49 | SizedBox() |
| 50 | ], |
| 51 | ), |
| 52 | ), |
| 53 | ) |
| 54 | ], |
| 55 | ), |
| 56 | ); |
| 57 | } |
| 58 | } |