Add default values for hive fields for Node, UnspentCoinsInfo, Wallet… (#598)

* Add default values for hive fields for Node, UnspentCoinsInfo, WalletInfo, Order, Contact, TransactionDescription, Trade
This commit is contained in:
mkyq
2022-11-04 15:55:21 -04:00
committed by GitHub
parent d40cd3ebad
commit 5d741b183f
7 changed files with 31 additions and 31 deletions
+7 -7
View File
@@ -30,10 +30,10 @@ class Order extends HiveObject {
static const boxName = 'Orders';
static const boxKey = 'ordersBoxKey';
@HiveField(0)
@HiveField(0, defaultValue: '')
String id;
@HiveField(1)
@HiveField(1, defaultValue: '')
String transferId;
@HiveField(2)
@@ -42,7 +42,7 @@ class Order extends HiveObject {
@HiveField(3)
String? to;
@HiveField(4)
@HiveField(4, defaultValue: '')
late String stateRaw;
TradeState get state => TradeState.deserialize(raw: stateRaw);
@@ -50,16 +50,16 @@ class Order extends HiveObject {
@HiveField(5)
DateTime createdAt;
@HiveField(6)
@HiveField(6, defaultValue: '')
String amount;
@HiveField(7)
@HiveField(7, defaultValue: '')
String receiveAddress;
@HiveField(8)
@HiveField(8, defaultValue: '')
String walletId;
@HiveField(9)
@HiveField(9, defaultValue: 0)
late int providerRaw;
BuyProviderDescription get provider =>
+3 -3
View File
@@ -17,13 +17,13 @@ class Contact extends HiveObject with Keyable {
static const typeId = 0;
static const boxName = 'Contacts';
@HiveField(0)
@HiveField(0, defaultValue: '')
String name;
@HiveField(1)
@HiveField(1, defaultValue: '')
String address;
@HiveField(2)
@HiveField(2, defaultValue: 0)
late int raw;
CryptoCurrency get type => CryptoCurrency.deserialize(raw: raw);
+1 -1
View File
@@ -10,7 +10,7 @@ class TransactionDescription extends HiveObject {
static const boxName = 'TransactionDescriptions';
static const boxKey = 'transactionDescriptionsBoxKey';
@HiveField(0)
@HiveField(0, defaultValue: '')
String id;
@HiveField(1)
+6 -6
View File
@@ -40,26 +40,26 @@ class Trade extends HiveObject {
static const boxName = 'Trades';
static const boxKey = 'tradesBoxKey';
@HiveField(0)
@HiveField(0, defaultValue: '')
String id;
@HiveField(1)
@HiveField(1, defaultValue: 0)
late int providerRaw;
ExchangeProviderDescription get provider =>
ExchangeProviderDescription.deserialize(raw: providerRaw);
@HiveField(2)
@HiveField(2, defaultValue: 0)
late int fromRaw;
CryptoCurrency get from => CryptoCurrency.deserialize(raw: fromRaw);
@HiveField(3)
@HiveField(3, defaultValue: 0)
late int toRaw;
CryptoCurrency get to => CryptoCurrency.deserialize(raw: toRaw);
@HiveField(4)
@HiveField(4, defaultValue: '')
late String stateRaw;
TradeState get state => TradeState.deserialize(raw: stateRaw);
@@ -70,7 +70,7 @@ class Trade extends HiveObject {
@HiveField(6)
DateTime? expiredAt;
@HiveField(7)
@HiveField(7, defaultValue: '')
String amount;
@HiveField(8)