fix(flutter): 调整播放页底部信息排版

This commit is contained in:
Zhou Weidong committed 2026-10-20 11:55:28 +08:00
1 parent 55d22a9940
commit d25519bed7
11 files changed
+236 -77

No files matched your search

@@ -90,7 +90,7 @@ class _BottomIconButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox.square(
dimension: 30,
dimension: 40,
child: IconButton(
tooltip: tooltip,
padding: EdgeInsets.zero,
@@ -99,7 +99,7 @@ class _BottomIconButton extends StatelessWidget {
foregroundColor: AppColors.onPrimary,
),
onPressed: onPressed,
icon: Icon(icon, size: 17),
icon: Icon(icon, size: 22),
),
);
}
@@ -235,78 +235,100 @@ class _EpisodeSynopsis extends StatefulWidget {
class _EpisodeSynopsisState extends State<_EpisodeSynopsis> {
bool _expanded = false;
static const TextStyle _labelStyle = TextStyle(
color: AppColors.onPrimary,
fontSize: 12,
fontWeight: FontWeight.w700,
shadows: _playerTextShadows,
);
static const TextStyle _synopsisStyle = TextStyle(
color: AppColors.playerMuted,
fontSize: 12,
height: 1.35,
shadows: _playerTextShadows,
);
@override
Widget build(BuildContext context) {
return Material(
color: Colors.transparent,
child: InkWell(
key: const Key('player-synopsis-toggle'),
onTap: () => setState(() => _expanded = !_expanded),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.l10n.episodeLabel(widget.episodeNumber),
key: const Key('player-episode-label'),
style: TextStyle(
color: AppColors.onPrimary,
fontSize: 11,
fontWeight: FontWeight.w700,
shadows: _playerTextShadows,
),
),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 6),
child: Text(
'|',
style: TextStyle(
color: Colors.white54,
shadows: _playerTextShadows,
),
),
),
Expanded(
child: Text(
widget.synopsis,
key: const Key('player-synopsis'),
maxLines: _expanded ? 3 : 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: AppColors.playerMuted,
fontSize: 11,
height: 1.35,
shadows: _playerTextShadows,
),
),
),
const SizedBox(width: 4),
Icon(
_expanded
? Icons.keyboard_arrow_up_rounded
: Icons.keyboard_arrow_down_rounded,
color: AppColors.playerMuted,
size: 16,
shadows: _playerTextShadows,
),
],
Text(
widget.l10n.episodeLabel(widget.episodeNumber),
key: const Key('player-episode-label'),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: _labelStyle,
),
if (_expanded && widget.authorNote.isNotEmpty) ...[
const SizedBox(height: 4),
Text(
widget.authorNote,
key: const Key('player-author-note'),
style: const TextStyle(
color: AppColors.playerMuted,
fontSize: 10,
const Padding(
padding: EdgeInsets.symmetric(horizontal: 6),
child: Text(
'|',
maxLines: 1,
style: TextStyle(
color: Colors.white54,
fontSize: 12,
shadows: _playerTextShadows,
),
),
],
),
Flexible(
child: Text(
widget.synopsis,
key: const Key('player-synopsis'),
maxLines: _expanded ? null : 1,
overflow: _expanded ? TextOverflow.clip : TextOverflow.ellipsis,
style: _synopsisStyle,
),
),
if (!_expanded) _toggle(widget.l10n.expandSynopsis),
],
),
if (_expanded) ...[
if (widget.authorNote.isNotEmpty) ...[
const SizedBox(height: 4),
Text(
widget.authorNote,
key: const Key('player-author-note'),
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
color: AppColors.playerMuted,
fontSize: 10,
shadows: _playerTextShadows,
),
),
],
_toggle(widget.l10n.showLess),
],
],
);
}
Widget _toggle(String label) {
return InkWell(
key: const Key('player-synopsis-toggle'),
onTap: () => setState(() => _expanded = !_expanded),
borderRadius: BorderRadius.circular(4),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 1),
child: Text(
label,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
color: AppColors.blue,
fontSize: 12,
fontWeight: FontWeight.w700,
shadows: _playerTextShadows,
),
),
),
);
}