mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-18 09:54:01 +01:00
* charts (wip) * charts (wip) * wip * add asset grid * split files * logic wip * proper getPrices logic * viewmodel (wip) * charts * remove unused import * remove restricted import...? * fix background gradient when scrolling * add safeguards for broken db * save new pin on removal * add safeguards for concurrency * add haptic feedback * fix haptic feedback * fix fiat ticker * reduce chart padding * add line touch indicator * improve touch target size on range selector * add date/time display when viewing past amount * merge * remove iconSvgPath reference * merge * fix state for date display * merge * auto-reformat * only load charts when page is opened * merge * reformat and apply lints * refactor to use `Money` instead of storing amount in `String` * add slop comment * fix exception on division by zero * ci * workaround toDouble being removed * disable strict parsing and rounding * fix abs() * use new currency picker sheet * safeguard for max flutter-supported decimals * fix amount precision * adjust to new buy/sell * Update lib/new-ui/pages/charts_page.dart Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> * adjust buy/sell di * replace -> ignore * reformat --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
66 lines
1.9 KiB
Dart
66 lines
1.9 KiB
Dart
import "package:cake_wallet/generated/i18n.dart";
|
|
import "package:cake_wallet/view_model/dashboard/dashboard_view_model.dart";
|
|
import "package:flutter/material.dart";
|
|
|
|
class NewMainActions {
|
|
|
|
NewMainActions._({
|
|
required this.key,
|
|
required this.name,
|
|
required this.image,
|
|
required this.onTap,
|
|
this.isEnabled,
|
|
this.canShow,
|
|
});
|
|
final Key key;
|
|
final String Function(BuildContext context) name;
|
|
final String image;
|
|
final VoidCallback onTap;
|
|
final bool Function(DashboardViewModel viewModel)? isEnabled;
|
|
final bool Function(DashboardViewModel viewModel)? canShow;
|
|
|
|
static List<NewMainActions> all = [
|
|
homeAction,
|
|
walletsAction,
|
|
contactsAction,
|
|
appsAction,
|
|
chartsAction,
|
|
];
|
|
|
|
static NewMainActions homeAction = NewMainActions._(
|
|
name: (context) => S.of(context).home,
|
|
image: "assets/new-ui/navbar/home.svg",
|
|
key: const ValueKey("dashboard_page_home_action_button_key"),
|
|
onTap: () {},
|
|
);
|
|
|
|
static NewMainActions walletsAction = NewMainActions._(
|
|
name: (context) => S.of(context).wallets,
|
|
image: "assets/new-ui/navbar/wallets.svg",
|
|
key: const ValueKey("dashboard_page_wallets_action_button_key"),
|
|
onTap: () {},
|
|
);
|
|
|
|
static NewMainActions contactsAction = NewMainActions._(
|
|
name: (context) => S.of(context).contacts,
|
|
image: "assets/new-ui/navbar/contacts.svg",
|
|
key: const ValueKey("dashboard_page_contacts_action_button_key"),
|
|
onTap: () {},
|
|
);
|
|
|
|
static NewMainActions appsAction = NewMainActions._(
|
|
name: (context) => S.of(context).apps,
|
|
image: "assets/new-ui/navbar/apps.svg",
|
|
key: const ValueKey("dashboard_page_apps_action_button_key"),
|
|
canShow: (dashboardVM) => dashboardVM.showApps,
|
|
onTap: () {},
|
|
);
|
|
|
|
static NewMainActions chartsAction = NewMainActions._(
|
|
name: (context) => S.of(context).charts,
|
|
image: "assets/new-ui/navbar/charts.svg",
|
|
key: const ValueKey("dashboard_page_charts_action_button_key"),
|
|
onTap: () {},
|
|
);
|
|
}
|