fix(flutter): 收紧播放页底部与互动栏

This commit is contained in:
Zhou Weidong committed 2026-10-20 11:12:12 +08:00
1 parent 7b4a792c12
commit cf93d8d794
10 files changed
+167 -240

No files matched your search

+13 -73
View File
@@ -1,8 +1,6 @@
// Author: fruit.com.cn
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import '../../../core/formatting/localized_content.dart';
import '../../../core/theme/app_colors.dart';
import '../../../core/theme/app_dimens.dart';
@@ -14,11 +12,10 @@ import 'seek_progress_bar.dart';
part 'player_overlay_parts.dart';
const double _topBarHeight = 58;
const double _topButtonSize = 36;
const double _railButtonSize = 36;
const double _railGap = 9;
const double _fullScreenPillBottom = 246;
const double _topBarHeight = 58;
const double _railButtonSize = 34;
const double _railGap = 18;
const double _panelRadius = 16;
/// K29 竖屏播放页浮层。
@@ -57,7 +54,6 @@ class PlayerPlaybackOverlay extends StatelessWidget {
_bottom(context),
_rail(context),
],
_fullScreenPill(),
if (!controlsVisible)
Positioned(
top: AppDimens.spaceSm,
@@ -144,7 +140,7 @@ class PlayerPlaybackOverlay extends StatelessWidget {
final compact = MediaQuery.sizeOf(context).height < 700;
return Positioned(
right: AppDimens.spaceMd,
top: _topBarHeight + (compact ? 18 : 54),
top: MediaQuery.sizeOf(context).height * (compact ? 0.42 : 0.55),
child: _Rail(
l10n: data.l10n,
liked: data.liked,
@@ -156,7 +152,6 @@ class PlayerPlaybackOverlay extends StatelessWidget {
onComments: actions.onComments,
onSave: actions.onSave,
onShare: actions.onShare,
compact: compact,
),
);
}
@@ -170,7 +165,7 @@ class PlayerPlaybackOverlay extends StatelessWidget {
bottom: 0,
child: Container(
key: const Key('player-controls-bottom'),
padding: const EdgeInsets.fromLTRB(14, 10, 14, 10),
padding: const EdgeInsets.fromLTRB(14, 8, 14, 6),
decoration: const BoxDecoration(
color: Color(0xED000000),
borderRadius: BorderRadius.vertical(
@@ -182,27 +177,16 @@ class PlayerPlaybackOverlay extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_detailRow(series),
const SizedBox(height: 6),
const SizedBox(height: 4),
_EpisodeSynopsis(
key: const Key('player-episode-synopsis'),
l10n: data.l10n,
episodeNumber: data.episode.number,
synopsis: synopsis,
authorNote: data.authorNote,
textScale: data.textScale,
),
if (data.authorNote.isNotEmpty) ...[
const SizedBox(height: 6),
Text(
data.authorNote,
key: const Key('player-author-note'),
style: const TextStyle(color: Colors.white60, fontSize: 11),
),
],
const SizedBox(height: 6),
_PlayerTimeLabel(
key: const Key('player-time-label'),
controller: data.controller,
),
const SizedBox(height: 2),
SeekProgressBar(
key: const Key('player-progress'),
valueListenable: data.controller,
@@ -226,7 +210,7 @@ class PlayerPlaybackOverlay extends StatelessWidget {
key: const Key('player-open-detail'),
onTap: actions.onDetail,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2),
padding: const EdgeInsets.symmetric(vertical: 1),
child: Row(
children: [
Expanded(
@@ -238,7 +222,7 @@ class PlayerPlaybackOverlay extends StatelessWidget {
style: TextStyle(
color: AppColors.onPrimary,
fontFamily: 'Outfit',
fontSize: 19 * data.textScale,
fontSize: 18 * data.textScale,
fontWeight: FontWeight.w800,
),
),
@@ -267,7 +251,7 @@ class PlayerPlaybackOverlay extends StatelessWidget {
onTap: actions.onEpisodes,
borderRadius: BorderRadius.circular(8),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
padding: const EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Flexible(
@@ -288,7 +272,7 @@ class PlayerPlaybackOverlay extends StatelessWidget {
const Icon(
Icons.keyboard_arrow_up_rounded,
color: AppColors.onPrimary,
size: 18,
size: 16,
),
],
),
@@ -298,57 +282,13 @@ class PlayerPlaybackOverlay extends StatelessWidget {
),
if (actions.onPip != null) ...[
const SizedBox(width: 8),
_TopButton(
_PipButton(
key: const Key('player-pip'),
tooltip: data.l10n.pictureInPicture,
icon: Icons.picture_in_picture_alt_rounded,
onPressed: actions.onPip!,
),
],
],
);
}
Widget _fullScreenPill() {
return Positioned(
left: 0,
right: 0,
bottom: _fullScreenPillBottom,
child: Center(
child: Material(
color: const Color(0x99000000),
borderRadius: BorderRadius.circular(999),
child: InkWell(
key: const Key('player-fullscreen-toggle'),
borderRadius: BorderRadius.circular(999),
onTap: controlsVisible ? actions.onClear : actions.onExitClear,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 7),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(
Icons.fullscreen_rounded,
color: AppColors.onPrimary,
size: 16,
),
const SizedBox(width: 5),
Text(
controlsVisible
? data.l10n.fullScreenWatch
: data.l10n.exitClearScreen,
style: const TextStyle(
color: AppColors.onPrimary,
fontSize: 12,
fontWeight: FontWeight.w700,
),
),
],
),
),
),
),
),
);
}
}