fix(ui): 小窗播放页内容撑满窗口
紧凑模式原来用 SingleChildScrollView 直接包内容, 内容不足窗口高度时底部会留一大片空白。 改为 LayoutBuilder + ConstrainedBox(minHeight) + IntrinsicHeight: - 内容不足时撑满并让 Spacer 把控件推到底部 - 内容超出时仍可滚动,不会把控件挤出屏幕 真机(Flyme 小窗)验证:封面缩小、歌词页隐藏、五个控件完整贴底。
This commit is contained in:
@@ -431,8 +431,7 @@ class _PlayerPageState extends BaseState<PlayerPage> {
|
||||
),
|
||||
],
|
||||
|
||||
if (!compact) const Spacer(),
|
||||
if (compact) const SizedBox(height: 12),
|
||||
const Spacer(),
|
||||
|
||||
// ---- 进度 ----
|
||||
_buildProgressSection(service),
|
||||
@@ -446,10 +445,17 @@ class _PlayerPageState extends BaseState<PlayerPage> {
|
||||
),
|
||||
);
|
||||
|
||||
// 小窗/横屏:内容超出时允许滚动,避免控件被挤出屏幕
|
||||
return compact
|
||||
? SingleChildScrollView(child: padded)
|
||||
: padded;
|
||||
if (!compact) return padded;
|
||||
|
||||
// 小窗/横屏:内容超高时可滚动;内容不足时撑满,避免底部大片空白
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) => SingleChildScrollView(
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(minHeight: constraints.maxHeight),
|
||||
child: IntrinsicHeight(child: padded),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// 左页:文件信息
|
||||
|
||||
Reference in New Issue
Block a user