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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 31 additions and 31 deletions

View file

@ -36,7 +36,7 @@ class Node extends HiveObject with Keyable {
static const typeId = 1;
static const boxName = 'Nodes';
@HiveField(0)
@HiveField(0, defaultValue: '')
late String uriRaw;
@HiveField(1)
@ -45,7 +45,7 @@ class Node extends HiveObject with Keyable {
@HiveField(2)
String? password;
@HiveField(3)
@HiveField(3, defaultValue: 0)
late int typeRaw;
@HiveField(4)

View file

@ -15,16 +15,16 @@ class UnspentCoinsInfo extends HiveObject {
static const boxName = 'Unspent';
static const boxKey = 'unspentBoxKey';
@HiveField(0)
@HiveField(0, defaultValue: '')
String walletId;
@HiveField(1)
@HiveField(1, defaultValue: '')
String hash;
@HiveField(2)
@HiveField(2, defaultValue: false)
bool isFrozen;
@HiveField(3)
@HiveField(3, defaultValue: false)
bool isSending;
@HiveField(4)

View file

@ -33,31 +33,31 @@ class WalletInfo extends HiveObject {
static const typeId = 4;
static const boxName = 'WalletInfo';
@HiveField(0)
@HiveField(0, defaultValue: '')
String id;
@HiveField(1)
@HiveField(1, defaultValue: '')
String name;
@HiveField(2)
WalletType type;
@HiveField(3)
@HiveField(3, defaultValue: false)
bool isRecovery;
@HiveField(4)
@HiveField(4, defaultValue: 0)
int restoreHeight;
@HiveField(5)
@HiveField(5, defaultValue: 0)
int timestamp;
@HiveField(6)
@HiveField(6, defaultValue: '')
String dirPath;
@HiveField(7)
@HiveField(7, defaultValue: '')
String path;
@HiveField(8)
@HiveField(8, defaultValue: '')
String address;
@HiveField(10)

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 =>

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);

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)

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)