mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-06 19:19:28 +00:00
feat: enhance UserBar with user API details and improved text styling
This commit is contained in:
parent
ad0cd6e2ad
commit
c8767b4e1e
1 changed files with 23 additions and 8 deletions
|
|
@ -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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue