|
|
|
@ -11,6 +11,7 @@ class AccountSpecificSettingsPage extends StatelessWidget {
|
|
|
|
|
final Account account; |
|
|
|
|
|
|
|
|
|
late final _options = bloc.getOptions(account)!; |
|
|
|
|
late final _userDetailsBloc = bloc.getUserDetailsBloc(account); |
|
|
|
|
late final _name = account.client.humanReadableID; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@ -44,8 +45,49 @@ class AccountSpecificSettingsPage extends StatelessWidget {
|
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
body: SettingsList( |
|
|
|
|
body: StandardRxResultBuilder<UserDetailsBloc, ProvisioningApiUserDetails>( |
|
|
|
|
bloc: _userDetailsBloc, |
|
|
|
|
state: (final bloc) => bloc.userDetails, |
|
|
|
|
builder: (final context, final userDetailsData, final userDetailsError, final userDetailsLoading, final _) => |
|
|
|
|
SettingsList( |
|
|
|
|
categories: [ |
|
|
|
|
SettingsCategory( |
|
|
|
|
title: Text(AppLocalizations.of(context).accountOptionsCategoryStorageInfo), |
|
|
|
|
tiles: [ |
|
|
|
|
CustomSettingsTile( |
|
|
|
|
title: Column( |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
if (userDetailsData != null) ...[ |
|
|
|
|
LinearProgressIndicator( |
|
|
|
|
value: userDetailsData.quota!.relative! / 100, |
|
|
|
|
backgroundColor: Theme.of(context).colorScheme.primary.withOpacity(0.3), |
|
|
|
|
), |
|
|
|
|
const SizedBox( |
|
|
|
|
height: 10, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
AppLocalizations.of(context).accountOptionsQuotaUsedOf( |
|
|
|
|
filesize(userDetailsData.quota!.used!, 1), |
|
|
|
|
filesize(userDetailsData.quota!.total!, 1), |
|
|
|
|
userDetailsData.quota!.relative!.toString(), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
ExceptionWidget( |
|
|
|
|
userDetailsError, |
|
|
|
|
onRetry: () { |
|
|
|
|
_userDetailsBloc.refresh(); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
CustomLinearProgressIndicator( |
|
|
|
|
visible: userDetailsLoading, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SettingsCategory( |
|
|
|
|
title: Text(AppLocalizations.of(context).optionsCategoryGeneral), |
|
|
|
|
tiles: [ |
|
|
|
@ -56,5 +98,6 @@ class AccountSpecificSettingsPage extends StatelessWidget {
|
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|