mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-25 05:58:42 +01:00
TMP
This commit is contained in:
@@ -4,7 +4,7 @@ import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
|
||||
|
||||
part 'contact.g.dart';
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 0)
|
||||
class Contact extends HiveObject {
|
||||
Contact({@required this.name, @required this.address, CryptoCurrency type})
|
||||
: raw = type?.raw;
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:hive/hive.dart';
|
||||
|
||||
part 'crypto_currency.g.dart';
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 0)
|
||||
class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
|
||||
const CryptoCurrency({final String title, final int raw})
|
||||
: super(title: title, raw: raw);
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:cake_wallet/src/domain/common/digest_request.dart';
|
||||
|
||||
part 'node.g.dart';
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 1)
|
||||
class Node extends HiveObject {
|
||||
Node({@required this.uri, this.login, this.password});
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ Future<String> presentQRScanner() async {
|
||||
try {
|
||||
final result = await BarcodeScanner.scan();
|
||||
isQrScannerShown = false;
|
||||
return result;
|
||||
return result.rawContent;
|
||||
} catch (e) {
|
||||
isQrScannerShown = false;
|
||||
rethrow;
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:hive/hive.dart';
|
||||
|
||||
part 'wallet_info.g.dart';
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 4)
|
||||
class WalletInfo extends HiveObject {
|
||||
WalletInfo(
|
||||
{this.id, this.name, this.type, this.isRecovery, this.restoreHeight});
|
||||
|
||||
@@ -4,7 +4,7 @@ part 'wallet_type.g.dart';
|
||||
|
||||
const walletTypes = [WalletType.monero, WalletType.bitcoin];
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 5)
|
||||
enum WalletType {
|
||||
@HiveField(0)
|
||||
monero,
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:cake_wallet/src/domain/common/format_amount.dart';
|
||||
|
||||
part 'trade.g.dart';
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 3)
|
||||
class Trade extends HiveObject {
|
||||
Trade(
|
||||
{this.id,
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:hive/hive.dart';
|
||||
|
||||
part 'transaction_description.g.dart';
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 2)
|
||||
class TransactionDescription extends HiveObject {
|
||||
TransactionDescription({this.id, this.recipientAddress});
|
||||
|
||||
|
||||
@@ -41,16 +41,16 @@ abstract class AcountListStoreBase with Store {
|
||||
StreamSubscription<Wallet> _onWalletChangeSubscription;
|
||||
StreamSubscription<List<Account>> _onAccountsChangeSubscription;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_onWalletChangeSubscription.cancel();
|
||||
// @override
|
||||
// void dispose() {
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
|
||||
if (_onAccountsChangeSubscription != null) {
|
||||
_onAccountsChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onAccountsChangeSubscription != null) {
|
||||
// _onAccountsChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
void updateAccountList() {
|
||||
_accountList.refresh();
|
||||
|
||||
@@ -155,21 +155,21 @@ abstract class ActionListBase with Store {
|
||||
StreamSubscription<BoxEvent> _onTransactionDescriptions;
|
||||
StreamSubscription<BoxEvent> _onTradesChanged;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (_onTransactionsChangeSubscription != null) {
|
||||
_onTransactionsChangeSubscription.cancel();
|
||||
}
|
||||
// @override
|
||||
// void dispose() {
|
||||
// if (_onTransactionsChangeSubscription != null) {
|
||||
// _onTransactionsChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
if (_onAccountChangeSubscription != null) {
|
||||
_onAccountChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onAccountChangeSubscription != null) {
|
||||
// _onAccountChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
_onTransactionDescriptions?.cancel();
|
||||
_onWalletChangeSubscription.cancel();
|
||||
_onTradesChanged?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
// _onTransactionDescriptions?.cancel();
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
// _onTradesChanged?.cancel();
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
@action
|
||||
Future updateTradeList() async => this.trades =
|
||||
|
||||
@@ -76,16 +76,16 @@ abstract class BalanceStoreBase with Store {
|
||||
SettingsStore _settingsStore;
|
||||
PriceStore _priceStore;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_onWalletChangeSubscription.cancel();
|
||||
// @override
|
||||
// void dispose() {
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
|
||||
if (_onBalanceChangeSubscription != null) {
|
||||
_onBalanceChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onBalanceChangeSubscription != null) {
|
||||
// _onBalanceChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
Future _onBalanceChange(Balance balance) async {
|
||||
if (balance is MoneroBalance) {
|
||||
|
||||
@@ -48,14 +48,14 @@ abstract class ExchangeTradeStoreBase with Store {
|
||||
|
||||
Timer _timer;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
// @override
|
||||
// void dispose() {
|
||||
// super.dispose();
|
||||
|
||||
if (_timer != null) {
|
||||
_timer.cancel();
|
||||
}
|
||||
}
|
||||
// if (_timer != null) {
|
||||
// _timer.cancel();
|
||||
// }
|
||||
// }
|
||||
|
||||
@action
|
||||
Future<void> _updateTrade() async {
|
||||
|
||||
@@ -29,14 +29,14 @@ abstract class NodeListBase with Store {
|
||||
|
||||
StreamSubscription<BoxEvent> _onNodesChangeSubscription;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
// @override
|
||||
// void dispose() {
|
||||
// super.dispose();
|
||||
|
||||
if (_onNodesChangeSubscription != null) {
|
||||
_onNodesChangeSubscription.cancel();
|
||||
}
|
||||
}
|
||||
// if (_onNodesChangeSubscription != null) {
|
||||
// _onNodesChangeSubscription.cancel();
|
||||
// }
|
||||
// }
|
||||
|
||||
@action
|
||||
void update() =>
|
||||
|
||||
@@ -39,16 +39,16 @@ abstract class SubadrressCreationStoreBase with Store {
|
||||
StreamSubscription<Account> _onAccountChangeSubscription;
|
||||
Account _account;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_onWalletChangeSubscription.cancel();
|
||||
// @override
|
||||
// void dispose() {
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
|
||||
if (_onAccountChangeSubscription != null) {
|
||||
_onAccountChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onAccountChangeSubscription != null) {
|
||||
// _onAccountChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
Future<void> add({String label}) async {
|
||||
try {
|
||||
|
||||
@@ -33,19 +33,19 @@ abstract class SubaddressListStoreBase with Store {
|
||||
StreamSubscription<Account> _onAccountChangeSubscription;
|
||||
Account _account;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (_onSubaddressesChangeSubscription != null) {
|
||||
_onSubaddressesChangeSubscription.cancel();
|
||||
}
|
||||
// @override
|
||||
// void dispose() {
|
||||
// if (_onSubaddressesChangeSubscription != null) {
|
||||
// _onSubaddressesChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
if (_onAccountChangeSubscription != null) {
|
||||
_onAccountChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onAccountChangeSubscription != null) {
|
||||
// _onAccountChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
_onWalletChangeSubscription.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
Future<void> _updateSubaddressList({int accountIndex}) async {
|
||||
await _subaddressList.refresh(accountIndex: accountIndex);
|
||||
|
||||
@@ -29,15 +29,15 @@ abstract class SyncStoreBase with Store {
|
||||
StreamSubscription<Wallet> _onWalletChangeSubscription;
|
||||
StreamSubscription<SyncStatus> _onSyncStatusChangeSubscription;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (_onSyncStatusChangeSubscription != null) {
|
||||
_onSyncStatusChangeSubscription.cancel();
|
||||
}
|
||||
// @override
|
||||
// void dispose() {
|
||||
// if (_onSyncStatusChangeSubscription != null) {
|
||||
// _onSyncStatusChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
_onWalletChangeSubscription.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
void _onWalletChanged(Wallet wallet) {
|
||||
if (_onSyncStatusChangeSubscription != null) {
|
||||
|
||||
@@ -63,22 +63,22 @@ abstract class WalletStoreBase with Store {
|
||||
StreamSubscription<Account> _onAccountChangeSubscription;
|
||||
StreamSubscription<Subaddress> _onSubaddressChangeSubscription;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (_onWalletChangeSubscription != null) {
|
||||
_onWalletChangeSubscription.cancel();
|
||||
}
|
||||
// @override
|
||||
// void dispose() {
|
||||
// if (_onWalletChangeSubscription != null) {
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
if (_onAccountChangeSubscription != null) {
|
||||
_onAccountChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onAccountChangeSubscription != null) {
|
||||
// _onAccountChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
if (_onSubaddressChangeSubscription != null) {
|
||||
_onSubaddressChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onSubaddressChangeSubscription != null) {
|
||||
// _onSubaddressChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
@action
|
||||
void setAccount(Account account) {
|
||||
|
||||
Reference in New Issue
Block a user