feat(player): 右侧互动栏图标按参考图替换并放大
This commit is contained in:
1 parent
e6a31a60df
commit
4b1aea29c7
5 files changed
+128
-24
No files matched your search
@@ -173,7 +173,7 @@ class _HomeFeedOverlayState extends State<HomeFeedOverlay> {
|
||||
items: [
|
||||
InteractionRailItem(
|
||||
key: const Key('rail-save'),
|
||||
icon: Icons.star_border_rounded,
|
||||
icon: Icons.star_rounded,
|
||||
activeIcon: Icons.star_rounded,
|
||||
label: widget.l10n.favorite,
|
||||
count: widget.favoriteCount,
|
||||
@@ -192,7 +192,7 @@ class _HomeFeedOverlayState extends State<HomeFeedOverlay> {
|
||||
),
|
||||
InteractionRailItem(
|
||||
key: const Key('rail-like'),
|
||||
icon: Icons.favorite_border_rounded,
|
||||
icon: Icons.favorite_rounded,
|
||||
activeIcon: Icons.favorite_rounded,
|
||||
label: widget.l10n.like,
|
||||
count: widget.likeCount,
|
||||
@@ -202,9 +202,10 @@ class _HomeFeedOverlayState extends State<HomeFeedOverlay> {
|
||||
),
|
||||
InteractionRailItem(
|
||||
key: const Key('rail-share'),
|
||||
icon: Icons.ios_share_rounded,
|
||||
activeIcon: Icons.ios_share_rounded,
|
||||
icon: Icons.reply_rounded,
|
||||
activeIcon: Icons.reply_rounded,
|
||||
label: widget.l10n.share,
|
||||
mirrorIcon: true,
|
||||
onTap: widget.onShare,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -5,10 +5,9 @@ import 'package:flutter/material.dart';
|
||||
import '../../../core/formatting/count_format.dart';
|
||||
import '../../../core/theme/app_colors.dart';
|
||||
|
||||
const double _buttonSize = 34;
|
||||
const double _iconSize = 24;
|
||||
const double _itemGap = 18;
|
||||
const Color _buttonBackground = Color(0x80000000);
|
||||
const double _buttonSize = 44;
|
||||
const double _iconSize = 30;
|
||||
const double _itemGap = 22;
|
||||
|
||||
/// 互动栏单项:图标、计数与点击。
|
||||
class InteractionRailItem {
|
||||
@@ -21,6 +20,7 @@ class InteractionRailItem {
|
||||
this.count,
|
||||
this.countKey,
|
||||
this.selected = false,
|
||||
this.mirrorIcon = false,
|
||||
});
|
||||
|
||||
final Key key;
|
||||
@@ -31,6 +31,7 @@ class InteractionRailItem {
|
||||
final int? count;
|
||||
final Key? countKey;
|
||||
final bool selected;
|
||||
final bool mirrorIcon;
|
||||
}
|
||||
|
||||
/// 播放页与首页 feed 共用的右侧互动栏:收藏/评论/喜欢/分享。
|
||||
@@ -60,6 +61,10 @@ class _RailButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final icon = Icon(
|
||||
item.selected ? item.activeIcon : item.icon,
|
||||
size: _iconSize,
|
||||
);
|
||||
return Column(
|
||||
key: item.key,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -69,14 +74,10 @@ class _RailButton extends StatelessWidget {
|
||||
child: IconButton(
|
||||
onPressed: item.onTap,
|
||||
padding: EdgeInsets.zero,
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: _buttonBackground,
|
||||
foregroundColor: item.selected ? AppColors.blue : Colors.white,
|
||||
),
|
||||
icon: Icon(
|
||||
item.selected ? item.activeIcon : item.icon,
|
||||
size: _iconSize,
|
||||
),
|
||||
color: item.selected ? AppColors.blue : Colors.white,
|
||||
icon: item.mirrorIcon
|
||||
? Transform.flip(flipX: true, child: icon)
|
||||
: icon,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
@@ -88,7 +89,7 @@ class _RailButton extends StatelessWidget {
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
height: 1,
|
||||
fontSize: 11,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
shadows: [Shadow(blurRadius: 6, color: Colors.black)],
|
||||
),
|
||||
|
||||
@@ -141,13 +141,13 @@ class PlayerPlaybackOverlay extends StatelessWidget {
|
||||
final compact = MediaQuery.sizeOf(context).height < 700;
|
||||
return Positioned(
|
||||
right: AppDimens.spaceMd,
|
||||
top: MediaQuery.sizeOf(context).height * (compact ? 0.42 : 0.55),
|
||||
top: MediaQuery.sizeOf(context).height * (compact ? 0.30 : 0.43),
|
||||
child: InteractionRail(
|
||||
key: const Key('player-interaction-rail'),
|
||||
items: [
|
||||
InteractionRailItem(
|
||||
key: const Key('player-rail-save'),
|
||||
icon: Icons.star_border_rounded,
|
||||
icon: Icons.star_rounded,
|
||||
activeIcon: Icons.star_rounded,
|
||||
label: data.l10n.favorite,
|
||||
count: data.favoriteCount,
|
||||
@@ -166,7 +166,7 @@ class PlayerPlaybackOverlay extends StatelessWidget {
|
||||
),
|
||||
InteractionRailItem(
|
||||
key: const Key('player-rail-like'),
|
||||
icon: Icons.favorite_border_rounded,
|
||||
icon: Icons.favorite_rounded,
|
||||
activeIcon: Icons.favorite_rounded,
|
||||
label: data.l10n.like,
|
||||
count: data.likeCount,
|
||||
@@ -176,9 +176,10 @@ class PlayerPlaybackOverlay extends StatelessWidget {
|
||||
),
|
||||
InteractionRailItem(
|
||||
key: const Key('player-rail-share'),
|
||||
icon: Icons.ios_share_rounded,
|
||||
activeIcon: Icons.ios_share_rounded,
|
||||
icon: Icons.reply_rounded,
|
||||
activeIcon: Icons.reply_rounded,
|
||||
label: data.l10n.share,
|
||||
mirrorIcon: true,
|
||||
onTap: actions.onShare,
|
||||
),
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user