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:
@@ -162,31 +162,39 @@ class _AppShellState extends ConsumerState<AppShell> {
|
|||||||
padding: EdgeInsets.only(top: topInset, left: isMobile ? 6 : 18, right: 14),
|
padding: EdgeInsets.only(top: topInset, left: isMobile ? 6 : 18, right: 14),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (isMobile) ...[
|
// 左组(占满剩余空间,靠左):把右组(主题器+铃)挤到最右
|
||||||
IconButton(
|
Expanded(
|
||||||
icon: Icon(Icons.menu, color: t.topFg),
|
child: Row(
|
||||||
tooltip: '菜单',
|
children: [
|
||||||
onPressed: () => _scaffoldKey.currentState?.openDrawer(),
|
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),
|
),
|
||||||
],
|
// 右组:主题器 + 通知铃,紧贴右侧
|
||||||
// 软件品牌(岩美酒库)—— 桌面常显,窄屏让位给门店
|
const SizedBox(width: 12),
|
||||||
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 ThemePickerPill(),
|
const ThemePickerPill(),
|
||||||
const SizedBox(width: 14),
|
const SizedBox(width: 14),
|
||||||
const NotificationBell(),
|
const NotificationBell(),
|
||||||
@@ -281,7 +289,9 @@ class _AppShellState extends ConsumerState<AppShell> {
|
|||||||
child: PopupMenuButton<String>(
|
child: PopupMenuButton<String>(
|
||||||
tooltip: '账号菜单',
|
tooltip: '账号菜单',
|
||||||
position: PopupMenuPosition.over,
|
position: PopupMenuPosition.over,
|
||||||
offset: const Offset(0, -8),
|
// 菜单与侧栏等宽(218),左对齐到侧栏左缘(抵消侧栏 12 内边距)
|
||||||
|
offset: const Offset(-12, -8),
|
||||||
|
constraints: const BoxConstraints.tightFor(width: 218),
|
||||||
shape:
|
shape:
|
||||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
|
RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
|
||||||
color: t.menuUserBg,
|
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 |
Reference in New Issue
Block a user