2023-08-15 00:47:25 +00:00
|
|
|
import 'package:cw_core/hive_type_ids.dart';
|
2020-05-08 16:22:56 +00:00
|
|
|
import 'package:hive/hive.dart';
|
|
|
|
|
|
|
|
part 'template.g.dart';
|
|
|
|
|
2021-01-15 17:41:30 +00:00
|
|
|
@HiveType(typeId: Template.typeId)
|
2020-05-08 16:22:56 +00:00
|
|
|
class Template extends HiveObject {
|
2023-08-01 22:19:04 +00:00
|
|
|
Template(
|
|
|
|
{required this.nameRaw,
|
|
|
|
required this.isCurrencySelectedRaw,
|
|
|
|
required this.addressRaw,
|
|
|
|
required this.cryptoCurrencyRaw,
|
|
|
|
required this.amountRaw,
|
|
|
|
required this.fiatCurrencyRaw,
|
|
|
|
required this.amountFiatRaw,
|
|
|
|
this.additionalRecipientsRaw});
|
2020-05-08 16:22:56 +00:00
|
|
|
|
2023-08-15 00:47:25 +00:00
|
|
|
static const typeId = TEMPLATE_TYPE_ID;
|
2020-05-08 16:22:56 +00:00
|
|
|
static const boxName = 'Template';
|
|
|
|
|
|
|
|
@HiveField(0)
|
2022-11-01 21:43:39 +00:00
|
|
|
String? nameRaw;
|
2020-05-08 16:22:56 +00:00
|
|
|
|
|
|
|
@HiveField(1)
|
2022-11-01 21:43:39 +00:00
|
|
|
String? addressRaw;
|
2020-05-08 16:22:56 +00:00
|
|
|
|
|
|
|
@HiveField(2)
|
2022-11-01 21:43:39 +00:00
|
|
|
String? cryptoCurrencyRaw;
|
2020-05-08 16:22:56 +00:00
|
|
|
|
|
|
|
@HiveField(3)
|
2022-11-01 21:43:39 +00:00
|
|
|
String? amountRaw;
|
2022-05-03 10:44:13 +00:00
|
|
|
|
|
|
|
@HiveField(4)
|
2022-11-01 21:43:39 +00:00
|
|
|
String? fiatCurrencyRaw;
|
2022-05-03 10:44:13 +00:00
|
|
|
|
|
|
|
@HiveField(5)
|
2022-11-01 21:43:39 +00:00
|
|
|
bool? isCurrencySelectedRaw;
|
2022-05-03 10:44:13 +00:00
|
|
|
|
|
|
|
@HiveField(6)
|
2022-11-01 21:43:39 +00:00
|
|
|
String? amountFiatRaw;
|
|
|
|
|
2023-08-01 22:19:04 +00:00
|
|
|
@HiveField(7)
|
|
|
|
List<Template>? additionalRecipientsRaw;
|
|
|
|
|
2022-11-01 21:43:39 +00:00
|
|
|
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 ?? '';
|
2022-05-03 10:44:13 +00:00
|
|
|
|
2023-08-04 17:01:49 +00:00
|
|
|
List<Template>? get additionalRecipients => additionalRecipientsRaw;
|
2023-08-01 22:19:04 +00:00
|
|
|
}
|