feat(flutter): 重构四 Tab 与浏览页
This commit is contained in:
1 parent
99c72e2c32
commit
959edc0a32
41 files changed
+2148
-1179
No files matched your search
@@ -944,43 +944,19 @@ class _PlaybackOverlayState extends State<_PlaybackOverlay> {
|
||||
backgroundColor: AppColors.card,
|
||||
showDragHandle: true,
|
||||
builder: (sheetContext) => SafeArea(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
key: const Key('player-more-speed'),
|
||||
leading: const Icon(
|
||||
Icons.speed_rounded,
|
||||
color: AppColors.secondary,
|
||||
),
|
||||
title: Text(widget.l10n.playbackSpeed),
|
||||
trailing: Text(
|
||||
_speedLabel(widget.playbackSpeed),
|
||||
style: const TextStyle(
|
||||
color: AppColors.blue,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) widget.onSpeedTap();
|
||||
});
|
||||
},
|
||||
),
|
||||
if (widget.qualities.isNotEmpty)
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
key: const Key('player-more-quality'),
|
||||
key: const Key('player-more-speed'),
|
||||
leading: const Icon(
|
||||
Icons.high_quality_rounded,
|
||||
Icons.speed_rounded,
|
||||
color: AppColors.secondary,
|
||||
),
|
||||
title: Text(widget.l10n.playbackQuality),
|
||||
title: Text(widget.l10n.playbackSpeed),
|
||||
trailing: Text(
|
||||
widget.qualities.contains(QualitySheet.autoQuality)
|
||||
? widget.l10n.qualityAuto
|
||||
: widget.qualities.first,
|
||||
_speedLabel(widget.playbackSpeed),
|
||||
style: const TextStyle(
|
||||
color: AppColors.blue,
|
||||
fontSize: 12,
|
||||
@@ -989,76 +965,105 @@ class _PlaybackOverlayState extends State<_PlaybackOverlay> {
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
widget.onQualityTap();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) widget.onSpeedTap();
|
||||
});
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
key: const Key('player-more-download'),
|
||||
leading: const Icon(
|
||||
Icons.download_outlined,
|
||||
color: AppColors.secondary,
|
||||
),
|
||||
title: Text(widget.l10n.downloads),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
widget.onDownload();
|
||||
},
|
||||
),
|
||||
if (widget.onPip != null)
|
||||
if (widget.qualities.isNotEmpty)
|
||||
ListTile(
|
||||
key: const Key('player-more-quality'),
|
||||
leading: const Icon(
|
||||
Icons.high_quality_rounded,
|
||||
color: AppColors.secondary,
|
||||
),
|
||||
title: Text(widget.l10n.playbackQuality),
|
||||
trailing: Text(
|
||||
widget.qualities.contains(QualitySheet.autoQuality)
|
||||
? widget.l10n.qualityAuto
|
||||
: widget.qualities.first,
|
||||
style: const TextStyle(
|
||||
color: AppColors.blue,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
widget.onQualityTap();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
key: const Key('player-more-pip'),
|
||||
key: const Key('player-more-download'),
|
||||
leading: const Icon(
|
||||
Icons.picture_in_picture_alt_outlined,
|
||||
Icons.download_outlined,
|
||||
color: AppColors.secondary,
|
||||
),
|
||||
title: Text(widget.l10n.pictureInPicture),
|
||||
title: Text(widget.l10n.downloads),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
widget.onPip!();
|
||||
widget.onDownload();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
key: const Key('player-more-like'),
|
||||
leading: Icon(
|
||||
widget.liked
|
||||
? Icons.favorite_rounded
|
||||
: Icons.favorite_border_rounded,
|
||||
color: widget.liked ? AppColors.blue : AppColors.muted,
|
||||
if (widget.onPip != null)
|
||||
ListTile(
|
||||
key: const Key('player-more-pip'),
|
||||
leading: const Icon(
|
||||
Icons.picture_in_picture_alt_outlined,
|
||||
color: AppColors.secondary,
|
||||
),
|
||||
title: Text(widget.l10n.pictureInPicture),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
widget.onPip!();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
key: const Key('player-more-like'),
|
||||
leading: Icon(
|
||||
widget.liked
|
||||
? Icons.favorite_rounded
|
||||
: Icons.favorite_border_rounded,
|
||||
color: widget.liked ? AppColors.blue : AppColors.muted,
|
||||
),
|
||||
title: Text(widget.l10n.like),
|
||||
trailing: widget.likeCount == null
|
||||
? null
|
||||
: Text(
|
||||
'${widget.likeCount}',
|
||||
key: const Key('player-more-like-count'),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
widget.onLike();
|
||||
},
|
||||
),
|
||||
title: Text(widget.l10n.like),
|
||||
trailing: widget.likeCount == null
|
||||
? null
|
||||
: Text(
|
||||
'${widget.likeCount}',
|
||||
key: const Key('player-more-like-count'),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
widget.onLike();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
key: const Key('player-more-favorite'),
|
||||
leading: Icon(
|
||||
widget.saved ? Icons.star_rounded : Icons.star_border_rounded,
|
||||
color: widget.saved ? AppColors.blue : AppColors.muted,
|
||||
ListTile(
|
||||
key: const Key('player-more-favorite'),
|
||||
leading: Icon(
|
||||
widget.saved ? Icons.star_rounded : Icons.star_border_rounded,
|
||||
color: widget.saved ? AppColors.blue : AppColors.muted,
|
||||
),
|
||||
title: Text(widget.l10n.favorite),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
widget.onSave();
|
||||
},
|
||||
),
|
||||
title: Text(widget.l10n.favorite),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
widget.onSave();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
key: const Key('player-more-share'),
|
||||
leading: const Icon(Icons.share_outlined, color: AppColors.muted),
|
||||
title: Text(widget.l10n.share),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
widget.onShare();
|
||||
},
|
||||
),
|
||||
],
|
||||
ListTile(
|
||||
key: const Key('player-more-share'),
|
||||
leading: const Icon(
|
||||
Icons.share_outlined,
|
||||
color: AppColors.muted,
|
||||
),
|
||||
title: Text(widget.l10n.share),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
widget.onShare();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user