CWA-220 | changed menu widget; changed primary account to primary subaddress in subaddress list; applied short address if the label of a subaddress is empty; applied full address when long press on subaddress tile without label; applied biometrical authentication button when the authentication switch is on; changed dismissible icon in the node list page

This commit is contained in:
Oleksandr Sobol
2020-06-05 12:34:15 +03:00
parent 872dbeb8ac
commit 289d8dca42
7 changed files with 363 additions and 314 deletions
@@ -15,6 +15,7 @@ class SubaddressListStore = SubaddressListStoreBase with _$SubaddressListStore;
abstract class SubaddressListStoreBase with Store {
SubaddressListStoreBase({@required WalletService walletService}) {
subaddresses = ObservableList<Subaddress>();
isShortAddressShow = ObservableList<bool>();
if (walletService.currentWallet != null) {
_onWalletChanged(walletService.currentWallet);
@@ -27,12 +28,20 @@ abstract class SubaddressListStoreBase with Store {
@observable
ObservableList<Subaddress> subaddresses;
@observable
ObservableList<bool> isShortAddressShow;
SubaddressList _subaddressList;
StreamSubscription<Wallet> _onWalletChangeSubscription;
StreamSubscription<List<Subaddress>> _onSubaddressesChangeSubscription;
StreamSubscription<Account> _onAccountChangeSubscription;
Account _account;
@action
void setShortAddressShow(int index, bool isShow) {
isShortAddressShow[index] = isShow;
}
@override
void dispose() {
if (_onSubaddressesChangeSubscription != null) {
@@ -47,6 +56,10 @@ abstract class SubaddressListStoreBase with Store {
super.dispose();
}
void updateShortAddressShow() {
isShortAddressShow = ObservableList.of(List.generate(subaddresses.length, (i) => true));
}
Future<void> _updateSubaddressList({int accountIndex}) async {
await _subaddressList.refresh(accountIndex: accountIndex);
subaddresses = ObservableList.of(_subaddressList.getAll());