import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import '../constant/color_res.dart'; import 'auth_gesture_detector.dart'; import 'my_txt.dart'; /// @author: bo.zeng /// @email: cnhbwds@gmail.com /// @date: 2025 2025/4/29 0:47 /// @description: class RightActionWidget extends ConsumerWidget { final bool isLike; final bool isFavorite; //0 点赞 1 收藏 2 分享 final Function(int) tap; const RightActionWidget({ super.key, required this.isLike, required this.isFavorite, required this.tap, }); @override Widget build(BuildContext context, WidgetRef ref) { return Row( children: [ AuthGestureDetector( onTap: () { tap.call(0); }, child: Row( children: [ Icon( isLike ? Icons.thumb_up_alt : Icons.thumb_up_alt_outlined, color: isLike ? Colors.red : color7788A0, size: 13.w, ), SizedBox(width: 1.w), myTxt(text: "点赞", color: color7788A0, fontSize: 13.sp), ], ), ), SizedBox(width: 5.h), AuthGestureDetector( onTap: () { tap.call(1); }, child: Row( children: [ Icon( isFavorite ? Icons.star : Icons.star_outline, color: isFavorite ? Colors.orange : color7788A0, size: 17.w, ), SizedBox(width: 1.w), myTxt(text: "收藏", color: color7788A0, fontSize: 13.sp), ], ), ), SizedBox(width: 5.h), GestureDetector( onTap: () { tap.call(2); }, child: Row( children: [ Icon(Icons.ios_share, color: color7788A0, size: 13.w), myTxt(text: "分享", color: color7788A0, fontSize: 13.sp), ], ), ), ], ); } }