| 1 | import 'package:cw_core/hive_type_ids.dart'; |
| 2 | import 'package:hive/hive.dart'; |
| 3 | |
| 4 | part 'template.part.dart'; |
| 5 | |
| 6 | // @HiveType(typeId: Template.typeId) |
| 7 | class Template extends HiveObject { |
| 8 | Template( |
| 9 | {required this.nameRaw, |
| 10 | required this.isCurrencySelectedRaw, |
| 11 | required this.addressRaw, |
| 12 | required this.cryptoCurrencyRaw, |
| 13 | required this.amountRaw, |
| 14 | required this.fiatCurrencyRaw, |
| 15 | required this.amountFiatRaw, |
| 16 | this.additionalRecipientsRaw}); |
| 17 | |
| 18 | static const typeId = TEMPLATE_TYPE_ID; |
| 19 | static const boxName = 'Template'; |
| 20 | |
| 21 | // @HiveField(0) |
| 22 | String? nameRaw; |
| 23 | |
| 24 | // @HiveField(1) |
| 25 | String? addressRaw; |
| 26 | |
| 27 | // @HiveField(2) |
| 28 | String? cryptoCurrencyRaw; |
| 29 | |
| 30 | // @HiveField(3) |
| 31 | String? amountRaw; |
| 32 | |
| 33 | // @HiveField(4) |
| 34 | String? fiatCurrencyRaw; |
| 35 | |
| 36 | // @HiveField(5) |
| 37 | bool? isCurrencySelectedRaw; |
| 38 | |
| 39 | // @HiveField(6) |
| 40 | String? amountFiatRaw; |
| 41 | |
| 42 | // @HiveField(7) |
| 43 | List<Template>? additionalRecipientsRaw; |
| 44 | |
| 45 | bool get isCurrencySelected => isCurrencySelectedRaw ?? false; |
| 46 | |
| 47 | String get fiatCurrency => fiatCurrencyRaw ?? ''; |
| 48 | |
| 49 | String get amountFiat => amountFiatRaw ?? ''; |
| 50 | |
| 51 | String get name => nameRaw ?? ''; |
| 52 | |
| 53 | String get address => addressRaw ?? ''; |
| 54 | |
| 55 | String get cryptoCurrency => cryptoCurrencyRaw ?? ''; |
| 56 | |
| 57 | String get amount => amountRaw ?? ''; |
| 58 | |
| 59 | List<Template>? get additionalRecipients => additionalRecipientsRaw; |
| 60 | } |