mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
Refactor user dropdown menu to display user's full name and arrow icon in a row for better layout consistency
This commit is contained in:
@ -41,13 +41,24 @@ class _UserDropdownMenuState extends State<UserDropdownMenu> {
|
|||||||
_isDropdownOpen = false;
|
_isDropdownOpen = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Transform.rotate(
|
child: Row(
|
||||||
angle: _isDropdownOpen ? -1.5708 : 1.5708,
|
children: [
|
||||||
child: const Icon(
|
const SizedBox(width: 12),
|
||||||
Icons.arrow_forward_ios,
|
if (widget.user != null)
|
||||||
color: Colors.white,
|
Text(
|
||||||
size: 16,
|
'${widget.user!.firstName} ${widget.user!.lastName}',
|
||||||
),
|
style: Theme.of(context).textTheme.bodyLarge,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Transform.rotate(
|
||||||
|
angle: _isDropdownOpen ? -1.5708 : 1.5708,
|
||||||
|
child: const Icon(
|
||||||
|
Icons.arrow_forward_ios,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -92,13 +92,6 @@ class DesktopAppBar extends StatelessWidget {
|
|||||||
if (rightBody != null) rightBody!,
|
if (rightBody != null) rightBody!,
|
||||||
const SizedBox(width: 24),
|
const SizedBox(width: 24),
|
||||||
_UserAvatar(),
|
_UserAvatar(),
|
||||||
const SizedBox(width: 12),
|
|
||||||
if (user != null)
|
|
||||||
Text(
|
|
||||||
'${user.firstName} ${user.lastName}',
|
|
||||||
style: Theme.of(context).textTheme.bodyLarge,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
UserDropdownMenu(user: user),
|
UserDropdownMenu(user: user),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -146,14 +139,6 @@ class TabletAppBar extends StatelessWidget {
|
|||||||
if (rightBody != null) rightBody!,
|
if (rightBody != null) rightBody!,
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
_UserAvatar(),
|
_UserAvatar(),
|
||||||
if (user != null) ...[
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
Text(
|
|
||||||
'${user.firstName} ${user.lastName}',
|
|
||||||
style:
|
|
||||||
Theme.of(context).textTheme.bodyLarge?.copyWith(fontSize: 14),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
UserDropdownMenu(user: user),
|
UserDropdownMenu(user: user),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -215,14 +200,6 @@ class MobileAppBar extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
_UserAvatar(),
|
_UserAvatar(),
|
||||||
if (user != null) ...[
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
Text(
|
|
||||||
'${user.firstName} ${user.lastName}',
|
|
||||||
style:
|
|
||||||
Theme.of(context).textTheme.bodyLarge?.copyWith(fontSize: 14),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
UserDropdownMenu(user: user),
|
UserDropdownMenu(user: user),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user