This commit is contained in:
M
2020-06-03 12:56:23 +03:00
parent e5d6586a6d
commit cfde445d32
6 changed files with 102 additions and 63 deletions
+16
View File
@@ -0,0 +1,16 @@
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/core/auth_service.dart';
import 'package:cake_wallet/core/wallet_base.dart';
import 'package:cake_wallet/core/wallet_creation_service.dart';
part 'app_service.g.dart';
class AppService = AppServiceBase with _$AppService;
abstract class AppServiceBase with Store {
AppServiceBase({this.walletCreationService, this.authService, this.wallet});
WalletCreationService walletCreationService;
AuthService authService;
WalletBase wallet;
}
-12
View File
@@ -1,12 +0,0 @@
import 'package:mobx/mobx.dart';
part 'app_store.g.dart';
class AppStore = AppStoreBase with _$AppStore;
abstract class AppStoreBase with Store {
// Sign Up
// Auth
// Wallet
// Settings
}
+2 -2
View File
@@ -24,7 +24,7 @@ part 'bitcoin_wallet.g.dart';
class BitcoinWallet = BitcoinWalletBase with _$BitcoinWallet;
abstract class BitcoinWalletBase extends WalletBase<BitcoinBalance> with Store {
static Future<BitcoinWallet> load(
static Future<BitcoinWalletBase> load(
{@required String name, @required String password}) async {
final walletDirPath =
await pathForWalletDir(name: name, type: WalletType.bitcoin);
@@ -37,7 +37,7 @@ abstract class BitcoinWalletBase extends WalletBase<BitcoinBalance> with Store {
? 0
: int.parse(jsoned['account_index'] as String);
return BitcoinWallet.build(
return BitcoinWalletBase.build(
mnemonic: mnemonic,
password: password,
name: name,
+4
View File
@@ -16,9 +16,13 @@ abstract class WalletCreationServiceBase with Store {
@observable
WalletCreationState state;
WalletType type;
WalletListService _service;
void changeWalletType({@required WalletType type}) {
this.type = type;
switch (type) {
case WalletType.monero:
_service = MoneroWalletListService();