Files
hash-wallet/cw_core/lib/account.dart
T
jwinterm 788318a3a2 style: format Dart at 100 columns, as upstream does
Upstream reformatted its whole tree in 16ddc0837. Matching it removes
formatting from the conflict surface of this and every later sync.
2026-10-24 22:48:17 -04:00

33 lines
761 B
Dart

class Account {
Account({
required this.id,
required this.label,
String? balance,
}) : balance = balance ?? "0.00";
Account.fromMap(Map<String, Object?> map)
: id = map["id"] is int ? map["id"] as int : int.tryParse(map["id"]?.toString() ?? "") ?? 0,
label = (map["label"] ?? "") as String,
balance = (map["balance"] ?? "0.00") as String;
final int id;
final String label;
final String balance;
Account copyWith({
int? id,
String? label,
String? balance,
}) => Account(
id: id ?? this.id,
label: label ?? this.label,
balance: balance ?? this.balance,
);
Map<String, Object> toMap() => {
"id": id.toString(),
"label": label,
"balance": balance,
};
}