Files
hash-wallet/lib/entities/page_indicator_actions.dart
T
cbf8e7d05d Cw 1247 improve tabs navigation (#2634)
* add dashboard page indicator

* refactor dashboard page indicator and UI

* refactor fade animation

* smoother UI transitions

* Improve accessibility for page indicator

* localize action names

* Update page indicator colors and blur effect

* fix page indicator layout

* Update Spanish translations for 'apps', 'history', and 'home'

* update dashboard labels

* changed settings page label

* Modify page_indicator.dart

* refactor page indicator animation

* review fixes

---------

Co-authored-by: Jaim3 <github@jaim3.com>
Co-authored-by: tuxsudo <tuxsudo@tux.pizza>
2025-11-14 15:34:54 +01:00

44 lines
1.4 KiB
Dart

import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:flutter/material.dart';
class PageIndicatorActions {
final String Function(BuildContext context) name;
final String image;
final Key key;
final bool Function(DashboardViewModel viewModel)? isEnabled;
PageIndicatorActions._({
required this.name,
required this.image,
required this.key,
this.isEnabled,
});
static List<PageIndicatorActions> all = [
appsAction,
homeAction,
historyAction,
];
static PageIndicatorActions appsAction = PageIndicatorActions._(
name: (context) => S.of(context).apps,
image: 'assets/images/main_actions/apps.svg',
key: ValueKey('dashboard_page_indicator_apps_action_button_key'),
isEnabled: (viewModel) => viewModel.shouldShowMarketPlaceInDashboard,
);
static PageIndicatorActions homeAction = PageIndicatorActions._(
name: (context) => S.of(context).home,
image: 'assets/images/main_actions/home.svg',
key: ValueKey('dashboard_page_indicator_home_action_button_key'),
);
static PageIndicatorActions historyAction = PageIndicatorActions._(
name: (context) => S.of(context).history,
image: 'assets/images/main_actions/history.svg',
key: ValueKey('dashboard_page_indicator_history_action_button_key'),
);
}