| 1 | import 'package:cake_wallet/generated/i18n.dart'; |
| 2 | import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; |
| 3 | import 'package:flutter/material.dart'; |
| 4 | |
| 5 | class NewMainActions { |
| 6 | final Key key; |
| 7 | final String Function(BuildContext context) name; |
| 8 | final String image; |
| 9 | final VoidCallback onTap; |
| 10 | final bool Function(DashboardViewModel viewModel)? isEnabled; |
| 11 | final bool Function(DashboardViewModel viewModel)? canShow; |
| 12 | |
| 13 | NewMainActions._({ |
| 14 | required this.key, |
| 15 | required this.name, |
| 16 | required this.image, |
| 17 | required this.onTap, |
| 18 | this.isEnabled, |
| 19 | this.canShow, |
| 20 | }); |
| 21 | |
| 22 | static List<NewMainActions> all = [ |
| 23 | homeAction, |
| 24 | walletsAction, |
| 25 | contactsAction, |
| 26 | appsAction, |
| 27 | //chartsAction, |
| 28 | ]; |
| 29 | |
| 30 | static NewMainActions homeAction = NewMainActions._( |
| 31 | name: (context) => S.of(context).home, |
| 32 | image: 'assets/new-ui/navbar/home.svg', |
| 33 | key: ValueKey('dashboard_page_home_action_button_key'), |
| 34 | onTap: () {}, |
| 35 | ); |
| 36 | |
| 37 | static NewMainActions walletsAction = NewMainActions._( |
| 38 | name: (context) => S.of(context).wallets, |
| 39 | image: 'assets/new-ui/navbar/wallets.svg', |
| 40 | key: ValueKey('dashboard_page_wallets_action_button_key'), |
| 41 | onTap: () {}, |
| 42 | ); |
| 43 | |
| 44 | static NewMainActions contactsAction = NewMainActions._( |
| 45 | name: (context) => S.of(context).contacts, |
| 46 | image: 'assets/new-ui/navbar/contacts.svg', |
| 47 | key: ValueKey('dashboard_page_contacts_action_button_key'), |
| 48 | onTap: () {}, |
| 49 | ); |
| 50 | |
| 51 | static NewMainActions appsAction = NewMainActions._( |
| 52 | name: (context) => S.of(context).apps, |
| 53 | image: 'assets/new-ui/navbar/apps.svg', |
| 54 | key: ValueKey('dashboard_page_apps_action_button_key'), |
| 55 | canShow: (dashboardVM) => dashboardVM.showApps, |
| 56 | onTap: () {}, |
| 57 | ); |
| 58 | |
| 59 | // static NewMainActions chartsAction = NewMainActions._( |
| 60 | // name: (context) => 'Charts', //TODO S.of(context).charts, |
| 61 | // image: 'assets/new-ui/navbar/charts.svg', |
| 62 | // key: ValueKey('dashboard_page_charts_action_button_key'), |
| 63 | // onTap: () {}, |
| 64 | // ); |
| 65 | } |