feat: enhance UserBar with user API details and improved text styling

This commit is contained in:
Dr.Blank 2025-04-23 14:51:39 +05:30
parent ad0cd6e2ad
commit c8767b4e1e
No known key found for this signature in database
GPG key ID: BA5F87FF0560C57B

View file

@ -183,6 +183,10 @@ class UserBar extends HookConsumerWidget {
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final me = ref.watch(meProvider); final me = ref.watch(meProvider);
final api = ref.watch(authenticatedApiProvider);
final themeData = Theme.of(context);
final textTheme = themeData.textTheme;
return me.when( return me.when(
data: (userData) { data: (userData) {
@ -194,20 +198,31 @@ class UserBar extends HookConsumerWidget {
// first letter of the username // first letter of the username
child: Text( child: Text(
userData.username[0].toUpperCase(), userData.username[0].toUpperCase(),
style: const TextStyle( style: textTheme.headlineLarge?.copyWith(
fontSize: 32,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
), ),
const SizedBox(width: 16), const SizedBox(width: 16),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text( Text(
userData.username, userData.username,
style: const TextStyle( style: textTheme.headlineSmall?.copyWith(
fontSize: 24,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
const SizedBox(height: 4),
Text(
api.baseUrl.toString(),
style: textTheme.bodyMedium?.copyWith(
color:
themeData.colorScheme.onSurface.withValues(alpha: 0.6),
),
),
],
),
], ],
); );
}, },