fix(client): 外壳两处对齐修正(顶栏右组靠右 + 用户菜单与侧栏等宽)

- 顶栏:左组(品牌+门店)改 Expanded 占满,主题器+通知铃挤到最右;
  原 Flexible(flex1) 与 Spacer(flex1) 平分剩余空间导致右组浮在中右
- 侧栏底部用户菜单:constraints 固定 218 宽 + offset 左对齐侧栏左缘,与侧栏等宽
- 状态栏操作员显示 realName(王经理)而非 username

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
This commit is contained in:
wangjia
2026-06-25 18:13:16 +08:00
parent 3f178f6a98
commit 4bfb79becd
4 changed files with 35 additions and 25 deletions
+35 -25
View File
@@ -162,31 +162,39 @@ class _AppShellState extends ConsumerState<AppShell> {
padding: EdgeInsets.only(top: topInset, left: isMobile ? 6 : 18, right: 14),
child: Row(
children: [
if (isMobile) ...[
IconButton(
icon: Icon(Icons.menu, color: t.topFg),
tooltip: '菜单',
onPressed: () => _scaffoldKey.currentState?.openDrawer(),
// 左组(占满剩余空间,靠左):把右组(主题器+铃)挤到最右
Expanded(
child: Row(
children: [
if (isMobile) ...[
IconButton(
icon: Icon(Icons.menu, color: t.topFg),
tooltip: '菜单',
onPressed: () => _scaffoldKey.currentState?.openDrawer(),
),
const SizedBox(width: 2),
],
// 软件品牌(岩美酒库)—— 桌面常显,窄屏让位给门店
if (!isMobile) ...[
const _SoftwareBrand(),
Container(
width: 1,
height: 20,
color: t.topBorder,
margin: const EdgeInsets.symmetric(horizontal: 8),
),
],
// 门店品牌(御品轩名酒坊)——点开门店信息;过长省略
Flexible(child: _ShopBrand(user: user)),
if (WriteGuard.isReadonly(ref)) ...[
const SizedBox(width: 10),
_readonlyBadge(t.topControl),
],
],
),
const SizedBox(width: 2),
],
// 软件品牌(岩美酒库)—— 桌面常显,窄屏让位给门店
if (!isMobile) ...[
const _SoftwareBrand(),
Container(
width: 1,
height: 20,
color: t.topBorder,
margin: const EdgeInsets.symmetric(horizontal: 8),
),
],
// 门店品牌(鼎晟酒行)——点开门店信息
Flexible(child: _ShopBrand(user: user)),
if (WriteGuard.isReadonly(ref)) ...[
const SizedBox(width: 10),
_readonlyBadge(t.topControl),
],
const Spacer(),
),
// 右组:主题器 + 通知铃,紧贴右侧
const SizedBox(width: 12),
const ThemePickerPill(),
const SizedBox(width: 14),
const NotificationBell(),
@@ -281,7 +289,9 @@ class _AppShellState extends ConsumerState<AppShell> {
child: PopupMenuButton<String>(
tooltip: '账号菜单',
position: PopupMenuPosition.over,
offset: const Offset(0, -8),
// 菜单与侧栏等宽(218),左对齐到侧栏左缘(抵消侧栏 12 内边距)
offset: const Offset(-12, -8),
constraints: const BoxConstraints.tightFor(width: 218),
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
color: t.menuUserBg,
Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB