design+client: 抽 .view-body/PageBody 统一桌面内容页宽度(600/wide 840)——stats·contact 补约束,settings·contact 560→600,九页收口
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P9G7E3wmAYL9KeYCVZVsqu
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// page_body.dart — 桌面内容页统一宽度容器(镜像 design/prototype/atoms.css 的 .view-body)。
|
||||
// 默认 600 居中;wide=true 840(多列网格页,如购买页)。手机屏宽 < 600 时约束自然不生效,可无条件包。
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
const double kViewMaxW = 600; // atoms.css .view-body
|
||||
const double kViewMaxWWide = 840; // atoms.css .view-body.is-wide
|
||||
|
||||
class PageBody extends StatelessWidget {
|
||||
const PageBody({super.key, required this.child, this.wide = false});
|
||||
final Widget child;
|
||||
final bool wide;
|
||||
@override
|
||||
Widget build(BuildContext context) => Center(
|
||||
child: ConstrainedBox(
|
||||
constraints:
|
||||
BoxConstraints(maxWidth: wide ? kViewMaxWWide : kViewMaxW),
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user