mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +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>
25 lines
641 B
Dart
25 lines
641 B
Dart
import 'package:cw_core/amount/money.dart';
|
|
|
|
abstract class Currency {
|
|
String get symbol;
|
|
String get name;
|
|
String? get fullName;
|
|
String? get iconPath;
|
|
int get decimals;
|
|
String? get tag;
|
|
|
|
/// Parse the [value] and turn it into [Money]
|
|
Money parseAmount(String value);
|
|
|
|
/// Try parsing the [value] and turn it into [Money]
|
|
Money? tryParseAmount(String value);
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
other is Currency && other.decimals == decimals && other.symbol == symbol && other.tag == tag;
|
|
|
|
@override
|
|
int get hashCode => decimals.hashCode ^ symbol.hashCode ^ tag.hashCode;
|
|
String get apiString;
|
|
}
|