|
|
@ -63,12 +63,10 @@ class AccountsBloc extends Bloc implements AccountsBlocEvents, AccountsBlocState |
|
|
|
void dispose() { |
|
|
|
void dispose() { |
|
|
|
unawaited(activeAccount.close()); |
|
|
|
unawaited(activeAccount.close()); |
|
|
|
unawaited(accounts.close()); |
|
|
|
unawaited(accounts.close()); |
|
|
|
for (final bloc in _userDetailsBlocs.values) { |
|
|
|
_appsBlocs.disposeAll(); |
|
|
|
bloc.dispose(); |
|
|
|
_capabilitiesBlocs.disposeAll(); |
|
|
|
} |
|
|
|
_userDetailsBlocs.disposeAll(); |
|
|
|
for (final bloc in _userStatusBlocs.values) { |
|
|
|
_userStatusBlocs.disposeAll(); |
|
|
|
bloc.dispose(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (final options in _accountsOptions.values) { |
|
|
|
for (final options in _accountsOptions.values) { |
|
|
|
options.dispose(); |
|
|
|
options.dispose(); |
|
|
|
} |
|
|
|
} |
|
|
@ -166,7 +164,9 @@ class AccountsBloc extends Bloc implements AccountsBlocEvents, AccountsBlocState |
|
|
|
|
|
|
|
|
|
|
|
CapabilitiesBloc getCapabilitiesBloc(final Account account) { |
|
|
|
CapabilitiesBloc getCapabilitiesBloc(final Account account) { |
|
|
|
if (_capabilitiesBlocs[account.id] != null) { |
|
|
|
if (_capabilitiesBlocs[account.id] != null) { |
|
|
|
return _capabilitiesBlocs[account.id]!; |
|
|
|
final bloc = _capabilitiesBlocs[account.id]!; |
|
|
|
|
|
|
|
unawaited(bloc.refresh()); |
|
|
|
|
|
|
|
return bloc; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return _capabilitiesBlocs[account.id] = CapabilitiesBloc( |
|
|
|
return _capabilitiesBlocs[account.id] = CapabilitiesBloc( |
|
|
|