@@ -12,7 +12,7 @@ part 'home_screen_view_model.g.dart';
12
12
13
13
class HomeScreenViewModel = HomeScreenViewModelBase with _$HomeScreenViewModel ;
14
14
15
- abstract class HomeScreenViewModelBase with ViewModel , Store {
15
+ abstract class HomeScreenViewModelBase extends ViewModel with Store {
16
16
HomeScreenViewModelBase ({required this .openLastWallet, this .lastOpenedWallet});
17
17
18
18
@override
@@ -29,7 +29,6 @@ abstract class HomeScreenViewModelBase with ViewModel, Store {
29
29
return WalletEdit (walletInfo: walletInfo).push (c! );
30
30
}
31
31
32
- @action
33
32
Future <void > createWallet (final CreateMethod method) async {
34
33
if (! mounted) return ;
35
34
return CreateWallet (
@@ -38,7 +37,6 @@ abstract class HomeScreenViewModelBase with ViewModel, Store {
38
37
).push (c! );
39
38
}
40
39
41
- @action
42
40
Future <void > loadInitialState (final BuildContext context) async {
43
41
await Future .delayed (Duration .zero); // load the screen
44
42
if (CupcakeConfig .instance.lastWallet == null ) return ;
@@ -48,7 +46,6 @@ abstract class HomeScreenViewModelBase with ViewModel, Store {
48
46
return CupcakeConfig .instance.lastWallet! .openUI (context);
49
47
}
50
48
51
- @action
52
49
Future <List <CoinWalletInfo >> wallets (final int sort) async {
53
50
final List <CoinWalletInfo > wallets = [];
54
51
for (final coin in walletCoins) {
@@ -68,7 +65,6 @@ abstract class HomeScreenViewModelBase with ViewModel, Store {
68
65
@observable
69
66
int varWalletSort = CupcakeConfig .instance.walletSort;
70
67
71
- @computed
72
68
set walletSort (final int value) {
73
69
varWalletSort = value;
74
70
CupcakeConfig .instance.walletSort = value;
@@ -80,5 +76,6 @@ abstract class HomeScreenViewModelBase with ViewModel, Store {
80
76
walletSort = (varWalletSort + 1 ) % 2 ;
81
77
}
82
78
79
+ @computed
83
80
Future <bool > get showLandingInfo async => (await wallets (varWalletSort)).isEmpty;
84
81
}
0 commit comments