|
|
@ -1,11 +1,12 @@ |
|
|
|
part of '../neon.dart'; |
|
|
|
part of '../neon.dart'; |
|
|
|
|
|
|
|
|
|
|
|
class AccountTile extends StatefulWidget { |
|
|
|
class AccountTile extends StatelessWidget { |
|
|
|
const AccountTile({ |
|
|
|
const AccountTile({ |
|
|
|
required this.account, |
|
|
|
required this.account, |
|
|
|
this.color, |
|
|
|
this.color, |
|
|
|
this.trailing, |
|
|
|
this.trailing, |
|
|
|
this.onTap, |
|
|
|
this.onTap, |
|
|
|
|
|
|
|
this.textColor, |
|
|
|
this.dense = false, |
|
|
|
this.dense = false, |
|
|
|
super.key, |
|
|
|
super.key, |
|
|
|
}); |
|
|
|
}); |
|
|
@ -14,39 +15,30 @@ class AccountTile extends StatefulWidget { |
|
|
|
final Color? color; |
|
|
|
final Color? color; |
|
|
|
final Widget? trailing; |
|
|
|
final Widget? trailing; |
|
|
|
final VoidCallback? onTap; |
|
|
|
final VoidCallback? onTap; |
|
|
|
|
|
|
|
final Color? textColor; |
|
|
|
final bool dense; |
|
|
|
final bool dense; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
State<AccountTile> createState() => _AccountTileState(); |
|
|
|
Widget build(final BuildContext context) { |
|
|
|
} |
|
|
|
final userDetailsBloc = RxBlocProvider.of<AccountsBloc>(context).getUserDetailsBloc(account); |
|
|
|
|
|
|
|
|
|
|
|
class _AccountTileState extends State<AccountTile> { |
|
|
|
|
|
|
|
late final UserDetailsBloc _userDetailsBloc; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
void initState() { |
|
|
|
|
|
|
|
super.initState(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_userDetailsBloc = RxBlocProvider.of<AccountsBloc>(context).getUserDetailsBloc(widget.account); |
|
|
|
return ListTile( |
|
|
|
} |
|
|
|
textColor: textColor, |
|
|
|
|
|
|
|
onTap: onTap, |
|
|
|
@override |
|
|
|
dense: dense, |
|
|
|
Widget build(final BuildContext context) => ListTile( |
|
|
|
contentPadding: dense ? EdgeInsets.zero : null, |
|
|
|
onTap: widget.onTap, |
|
|
|
visualDensity: dense |
|
|
|
dense: widget.dense, |
|
|
|
|
|
|
|
contentPadding: widget.dense ? EdgeInsets.zero : null, |
|
|
|
|
|
|
|
visualDensity: widget.dense |
|
|
|
|
|
|
|
? const VisualDensity( |
|
|
|
? const VisualDensity( |
|
|
|
horizontal: -4, |
|
|
|
horizontal: -4, |
|
|
|
vertical: -4, |
|
|
|
vertical: -4, |
|
|
|
) |
|
|
|
) |
|
|
|
: null, |
|
|
|
: null, |
|
|
|
leading: AccountAvatar( |
|
|
|
leading: AccountAvatar( |
|
|
|
account: widget.account, |
|
|
|
account: account, |
|
|
|
requestManager: Provider.of<RequestManager>(context), |
|
|
|
requestManager: Provider.of<RequestManager>(context), |
|
|
|
), |
|
|
|
), |
|
|
|
title: StandardRxResultBuilder<UserDetailsBloc, ProvisioningApiUserDetails>( |
|
|
|
title: StandardRxResultBuilder<UserDetailsBloc, ProvisioningApiUserDetails>( |
|
|
|
bloc: _userDetailsBloc, |
|
|
|
bloc: userDetailsBloc, |
|
|
|
state: (final bloc) => bloc.userDetails, |
|
|
|
state: (final bloc) => bloc.userDetails, |
|
|
|
builder: ( |
|
|
|
builder: ( |
|
|
|
final context, |
|
|
|
final context, |
|
|
@ -61,7 +53,7 @@ class _AccountTileState extends State<AccountTile> { |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
userDetailsData.getDisplayName()!, |
|
|
|
userDetailsData.getDisplayName()!, |
|
|
|
style: Theme.of(context).textTheme.bodyLarge!.copyWith( |
|
|
|
style: Theme.of(context).textTheme.bodyLarge!.copyWith( |
|
|
|
color: widget.color, |
|
|
|
color: textColor, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
@ -74,7 +66,7 @@ class _AccountTileState extends State<AccountTile> { |
|
|
|
width: 10, |
|
|
|
width: 10, |
|
|
|
child: CircularProgressIndicator( |
|
|
|
child: CircularProgressIndicator( |
|
|
|
strokeWidth: 1, |
|
|
|
strokeWidth: 1, |
|
|
|
color: widget.color, |
|
|
|
color: color, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
@ -85,17 +77,18 @@ class _AccountTileState extends State<AccountTile> { |
|
|
|
Icon( |
|
|
|
Icon( |
|
|
|
Icons.error_outline, |
|
|
|
Icons.error_outline, |
|
|
|
size: 20, |
|
|
|
size: 20, |
|
|
|
color: widget.color, |
|
|
|
color: color, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
subtitle: Text( |
|
|
|
subtitle: Text( |
|
|
|
widget.account.client.humanReadableID, |
|
|
|
account.client.humanReadableID, |
|
|
|
style: Theme.of(context).textTheme.bodySmall!.copyWith( |
|
|
|
style: Theme.of(context).textTheme.bodySmall!.copyWith( |
|
|
|
color: widget.color, |
|
|
|
color: textColor, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|