dev
dart 61 lines 2.22 KB
Raw
1 import 'package:cake_wallet/entities/new_ui_entities/list_item/list_item_regular_row.dart';
2 import 'package:cake_wallet/generated/i18n.dart';
3 import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
4 import 'package:cake_wallet/src/widgets/new_list_row/new_list_section.dart';
5 import 'package:cw_core/crypto_currency.dart';
6 import 'package:flutter/material.dart';
7
8 class FavoriteTokenModal extends StatelessWidget {
9 const FavoriteTokenModal({super.key, required this.tokens});
10
11 final List<CryptoCurrency> tokens;
12
13 @override
14 Widget build(BuildContext context) {
15 return Container(
16 decoration: BoxDecoration(
17 color: Theme.of(context).colorScheme.surface,
18 borderRadius: BorderRadius.vertical(top: Radius.circular(18))),
19 child: SafeArea(
20 child: Column(
21 children: [
22 ModalTopBar(
23 title: S.of(context).favorite_token,
24 leadingIcon: Icon(Icons.close),
25 leadingSemanticLabel: S.of(context).close,
26 onLeadingPressed: Navigator.of(context).pop,
27 ),
28 Expanded(
29 child: Column(
30 children: [
31 Text(
32 S.of(context).favorite_token_desc,
33 style: TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant),
34 ),
35 Expanded(
36 child: Padding(
37 padding: const EdgeInsets.all(12.0),
38 child: SingleChildScrollView(
39 child: NewListSections(
40 sections: {
41 "": tokens
42 .map((item) => ListItemRegularRow(
43 keyValue: item.title,
44 label: "${item.fullName} (${item.title})",
45 iconPath: item.iconPath,
46 onTap: () => Navigator.of(context).pop(item)))
47 .toList()
48 },
49 ),
50 ),
51 ),
52 )
53 ],
54 ),
55 )
56 ],
57 ),
58 ),
59 );
60 }
61 }