| 1 | import 'package:cake_wallet/generated/i18n.dart'; |
| 2 | import 'package:cake_wallet/routes.dart'; |
| 3 | import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; |
| 4 | import 'package:flutter/material.dart'; |
| 5 | |
| 6 | class PageIndicatorActions { |
| 7 | final String Function(BuildContext context) name; |
| 8 | final String image; |
| 9 | final Key key; |
| 10 | final bool Function(DashboardViewModel viewModel)? isEnabled; |
| 11 | |
| 12 | PageIndicatorActions._({ |
| 13 | required this.name, |
| 14 | required this.image, |
| 15 | required this.key, |
| 16 | this.isEnabled, |
| 17 | }); |
| 18 | |
| 19 | static List<PageIndicatorActions> all = [ |
| 20 | appsAction, |
| 21 | homeAction, |
| 22 | historyAction, |
| 23 | ]; |
| 24 | |
| 25 | static PageIndicatorActions appsAction = PageIndicatorActions._( |
| 26 | name: (context) => S.of(context).apps, |
| 27 | image: 'assets/images/main_actions/apps.svg', |
| 28 | key: ValueKey('dashboard_page_indicator_apps_action_button_key'), |
| 29 | isEnabled: (viewModel) => viewModel.shouldShowMarketPlaceInDashboard, |
| 30 | ); |
| 31 | |
| 32 | static PageIndicatorActions homeAction = PageIndicatorActions._( |
| 33 | name: (context) => S.of(context).home, |
| 34 | image: 'assets/images/main_actions/home.svg', |
| 35 | key: ValueKey('dashboard_page_indicator_home_action_button_key'), |
| 36 | ); |
| 37 | |
| 38 | static PageIndicatorActions historyAction = PageIndicatorActions._( |
| 39 | name: (context) => S.of(context).history, |
| 40 | image: 'assets/images/main_actions/history.svg', |
| 41 | key: ValueKey('dashboard_page_indicator_history_action_button_key'), |
| 42 | ); |
| 43 | } |