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

View file

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

View file

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

View file

@ -30,10 +30,10 @@ class Order extends HiveObject {
static const boxName = 'Orders'; static const boxName = 'Orders';
static const boxKey = 'ordersBoxKey'; static const boxKey = 'ordersBoxKey';
@HiveField(0) @HiveField(0, defaultValue: '')
String id; String id;
@HiveField(1) @HiveField(1, defaultValue: '')
String transferId; String transferId;
@HiveField(2) @HiveField(2)
@ -42,7 +42,7 @@ class Order extends HiveObject {
@HiveField(3) @HiveField(3)
String? to; String? to;
@HiveField(4) @HiveField(4, defaultValue: '')
late String stateRaw; late String stateRaw;
TradeState get state => TradeState.deserialize(raw: stateRaw); TradeState get state => TradeState.deserialize(raw: stateRaw);
@ -50,16 +50,16 @@ class Order extends HiveObject {
@HiveField(5) @HiveField(5)
DateTime createdAt; DateTime createdAt;
@HiveField(6) @HiveField(6, defaultValue: '')
String amount; String amount;
@HiveField(7) @HiveField(7, defaultValue: '')
String receiveAddress; String receiveAddress;
@HiveField(8) @HiveField(8, defaultValue: '')
String walletId; String walletId;
@HiveField(9) @HiveField(9, defaultValue: 0)
late int providerRaw; late int providerRaw;
BuyProviderDescription get provider => BuyProviderDescription get provider =>

View file

@ -17,13 +17,13 @@ class Contact extends HiveObject with Keyable {
static const typeId = 0; static const typeId = 0;
static const boxName = 'Contacts'; static const boxName = 'Contacts';
@HiveField(0) @HiveField(0, defaultValue: '')
String name; String name;
@HiveField(1) @HiveField(1, defaultValue: '')
String address; String address;
@HiveField(2) @HiveField(2, defaultValue: 0)
late int raw; late int raw;
CryptoCurrency get type => CryptoCurrency.deserialize(raw: raw); CryptoCurrency get type => CryptoCurrency.deserialize(raw: raw);

View file

@ -10,7 +10,7 @@ class TransactionDescription extends HiveObject {
static const boxName = 'TransactionDescriptions'; static const boxName = 'TransactionDescriptions';
static const boxKey = 'transactionDescriptionsBoxKey'; static const boxKey = 'transactionDescriptionsBoxKey';
@HiveField(0) @HiveField(0, defaultValue: '')
String id; String id;
@HiveField(1) @HiveField(1)

View file

@ -40,26 +40,26 @@ class Trade extends HiveObject {
static const boxName = 'Trades'; static const boxName = 'Trades';
static const boxKey = 'tradesBoxKey'; static const boxKey = 'tradesBoxKey';
@HiveField(0) @HiveField(0, defaultValue: '')
String id; String id;
@HiveField(1) @HiveField(1, defaultValue: 0)
late int providerRaw; late int providerRaw;
ExchangeProviderDescription get provider => ExchangeProviderDescription get provider =>
ExchangeProviderDescription.deserialize(raw: providerRaw); ExchangeProviderDescription.deserialize(raw: providerRaw);
@HiveField(2) @HiveField(2, defaultValue: 0)
late int fromRaw; late int fromRaw;
CryptoCurrency get from => CryptoCurrency.deserialize(raw: fromRaw); CryptoCurrency get from => CryptoCurrency.deserialize(raw: fromRaw);
@HiveField(3) @HiveField(3, defaultValue: 0)
late int toRaw; late int toRaw;
CryptoCurrency get to => CryptoCurrency.deserialize(raw: toRaw); CryptoCurrency get to => CryptoCurrency.deserialize(raw: toRaw);
@HiveField(4) @HiveField(4, defaultValue: '')
late String stateRaw; late String stateRaw;
TradeState get state => TradeState.deserialize(raw: stateRaw); TradeState get state => TradeState.deserialize(raw: stateRaw);
@ -70,7 +70,7 @@ class Trade extends HiveObject {
@HiveField(6) @HiveField(6)
DateTime? expiredAt; DateTime? expiredAt;
@HiveField(7) @HiveField(7, defaultValue: '')
String amount; String amount;
@HiveField(8) @HiveField(8)