mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
fcf4fbdc14
* feat: Support Send templates with multiple recipients * feat: use only first name for template display, and sum total amount * fix: amounts being wiped * feat: make send template card buttons function like send card * feat: replace amount -> name for template name * fix: template name
59 lines
1.2 KiB
Dart
59 lines
1.2 KiB
Dart
import 'package:hive/hive.dart';
|
|
|
|
part 'template.g.dart';
|
|
|
|
@HiveType(typeId: Template.typeId)
|
|
class Template extends HiveObject {
|
|
Template(
|
|
{required this.nameRaw,
|
|
required this.isCurrencySelectedRaw,
|
|
required this.addressRaw,
|
|
required this.cryptoCurrencyRaw,
|
|
required this.amountRaw,
|
|
required this.fiatCurrencyRaw,
|
|
required this.amountFiatRaw,
|
|
this.additionalRecipientsRaw});
|
|
|
|
static const typeId = 6;
|
|
static const boxName = 'Template';
|
|
|
|
@HiveField(0)
|
|
String? nameRaw;
|
|
|
|
@HiveField(1)
|
|
String? addressRaw;
|
|
|
|
@HiveField(2)
|
|
String? cryptoCurrencyRaw;
|
|
|
|
@HiveField(3)
|
|
String? amountRaw;
|
|
|
|
@HiveField(4)
|
|
String? fiatCurrencyRaw;
|
|
|
|
@HiveField(5)
|
|
bool? isCurrencySelectedRaw;
|
|
|
|
@HiveField(6)
|
|
String? amountFiatRaw;
|
|
|
|
@HiveField(7)
|
|
List<Template>? additionalRecipientsRaw;
|
|
|
|
bool get isCurrencySelected => isCurrencySelectedRaw ?? false;
|
|
|
|
String get fiatCurrency => fiatCurrencyRaw ?? '';
|
|
|
|
String get amountFiat => amountFiatRaw ?? '';
|
|
|
|
String get name => nameRaw ?? '';
|
|
|
|
String get address => addressRaw ?? '';
|
|
|
|
String get cryptoCurrency => cryptoCurrencyRaw ?? '';
|
|
|
|
String get amount => amountRaw ?? '';
|
|
|
|
List<Template>? get additionalRecipients => additionalRecipientsRaw ?? null;
|
|
}
|