feat(player): 互动栏改用参考图同款图标资源
This commit is contained in:
1 parent
35de4095b0
commit
cbb9f60f7f
10 files changed
+61
-78
No files matched your search
@@ -6,32 +6,28 @@ import '../../../core/formatting/count_format.dart';
|
||||
import '../../../core/theme/app_colors.dart';
|
||||
|
||||
const double _buttonSize = 44;
|
||||
const double _iconSize = 30;
|
||||
const double _itemGap = 22;
|
||||
const double _iconSize = 32;
|
||||
const double _itemGap = 24;
|
||||
|
||||
/// 互动栏单项:图标、计数与点击。
|
||||
class InteractionRailItem {
|
||||
const InteractionRailItem({
|
||||
required this.key,
|
||||
required this.icon,
|
||||
required this.activeIcon,
|
||||
required this.asset,
|
||||
required this.label,
|
||||
required this.onTap,
|
||||
this.count,
|
||||
this.countKey,
|
||||
this.selected = false,
|
||||
this.mirrorIcon = false,
|
||||
});
|
||||
|
||||
final Key key;
|
||||
final IconData icon;
|
||||
final IconData activeIcon;
|
||||
final String asset;
|
||||
final String label;
|
||||
final VoidCallback onTap;
|
||||
final int? count;
|
||||
final Key? countKey;
|
||||
final bool selected;
|
||||
final bool mirrorIcon;
|
||||
}
|
||||
|
||||
/// 播放页与首页 feed 共用的右侧互动栏:收藏/评论/喜欢/分享。
|
||||
@@ -61,10 +57,6 @@ 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,
|
||||
@@ -74,10 +66,14 @@ class _RailButton extends StatelessWidget {
|
||||
child: IconButton(
|
||||
onPressed: item.onTap,
|
||||
padding: EdgeInsets.zero,
|
||||
color: item.selected ? AppColors.blue : Colors.white,
|
||||
icon: item.mirrorIcon
|
||||
? Transform.flip(flipX: true, child: icon)
|
||||
: icon,
|
||||
icon: Image.asset(
|
||||
item.asset,
|
||||
width: _iconSize,
|
||||
height: _iconSize,
|
||||
fit: BoxFit.contain,
|
||||
color: item.selected ? AppColors.blue : Colors.white,
|
||||
colorBlendMode: BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
|
||||
Reference in new issue
Block a user