mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-19 10:00:13 +08:00
@@ -3,8 +3,8 @@ import 'dart:math';
|
||||
import 'package:PiliPlus/common/style.dart';
|
||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/custom_icon.dart';
|
||||
import 'package:PiliPlus/common/widgets/dialog/dialog.dart';
|
||||
import 'package:PiliPlus/common/widgets/icon/bili_icons.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/image_viewer/hero.dart';
|
||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||
@@ -395,8 +395,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
animation: introController.tripleAnimation,
|
||||
icon: const Icon(FontAwesomeIcons.thumbsUp),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidThumbsUp),
|
||||
icon: const Icon(BiliIcons.ugcvideo_ic_like),
|
||||
selectStatus: introController.hasLike.value,
|
||||
text: NumUtils.numFormat(item.stat!.like),
|
||||
onStartTriple: introController.onStartTriple,
|
||||
@@ -406,8 +405,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
animation: introController.tripleAnimation,
|
||||
icon: const Icon(FontAwesomeIcons.b),
|
||||
selectIcon: const Icon(FontAwesomeIcons.b),
|
||||
icon: const Icon(BiliIcons.ugcvideo_ic_coin, size: 20),
|
||||
onTap: introController.actionCoinVideo,
|
||||
selectStatus: introController.hasCoin,
|
||||
text: NumUtils.numFormat(item.stat!.coin),
|
||||
@@ -416,8 +414,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
animation: introController.tripleAnimation,
|
||||
icon: const Icon(FontAwesomeIcons.star),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidStar),
|
||||
icon: const Icon(BiliIcons.ugcvideo_ic_favorite),
|
||||
onTap: () => introController.showFavBottomSheet(context),
|
||||
onLongPress: () => introController.showFavBottomSheet(
|
||||
context,
|
||||
@@ -428,14 +425,13 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(CustomIcons.download),
|
||||
icon: const Icon(BiliIcons.ugcvideo_ic_offline),
|
||||
onTap: () => videoDetailCtr.onDownload(context),
|
||||
text: '缓存',
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.clock),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidClock),
|
||||
icon: const Icon(FontAwesomeIcons.solidClock, size: 19),
|
||||
onTap: () =>
|
||||
introController.handleAction(introController.viewLater),
|
||||
selectStatus: introController.hasLater.value,
|
||||
@@ -443,7 +439,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.shareFromSquare),
|
||||
icon: const Icon(BiliIcons.ugcvideo_ic_share),
|
||||
onTap: () => introController.actionShareVideo(context),
|
||||
selectStatus: false,
|
||||
text: NumUtils.numFormat(item.stat!.share),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/style.dart';
|
||||
import 'package:PiliPlus/common/widgets/custom_icon.dart';
|
||||
import 'package:PiliPlus/common/widgets/dialog/dialog.dart';
|
||||
import 'package:PiliPlus/common/widgets/gesture/tap_gesture_recognizer.dart';
|
||||
import 'package:PiliPlus/common/widgets/icon/bili_icons.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||
@@ -515,8 +515,7 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
animation: introController.tripleAnimation,
|
||||
icon: const Icon(FontAwesomeIcons.thumbsUp),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidThumbsUp),
|
||||
icon: const Icon(BiliIcons.ugcvideo_ic_like),
|
||||
selectStatus: introController.hasLike.value,
|
||||
text: !isLoading
|
||||
? NumUtils.numFormat(videoDetail.stat!.like)
|
||||
@@ -527,8 +526,7 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.thumbsDown),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidThumbsDown),
|
||||
icon: const Icon(BiliIcons.ugcvideo_ic_dislike),
|
||||
onTap: () => introController.handleAction(
|
||||
introController.actionDislikeVideo,
|
||||
),
|
||||
@@ -539,8 +537,7 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
animation: introController.tripleAnimation,
|
||||
icon: const Icon(FontAwesomeIcons.b),
|
||||
selectIcon: const Icon(FontAwesomeIcons.b),
|
||||
icon: const Icon(BiliIcons.ugcvideo_ic_coin, size: 20),
|
||||
onTap: introController.actionCoinVideo,
|
||||
selectStatus: introController.hasCoin,
|
||||
text: !isLoading
|
||||
@@ -551,8 +548,7 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
animation: introController.tripleAnimation,
|
||||
icon: const Icon(FontAwesomeIcons.star),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidStar),
|
||||
icon: const Icon(BiliIcons.ugcvideo_ic_favorite),
|
||||
onTap: () => introController.showFavBottomSheet(context),
|
||||
onLongPress: () => introController.showFavBottomSheet(
|
||||
context,
|
||||
@@ -565,14 +561,13 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(CustomIcons.download),
|
||||
icon: const Icon(BiliIcons.ugcvideo_ic_offline),
|
||||
onTap: () => videoDetailCtr.onDownload(context),
|
||||
text: '缓存',
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.clock),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidClock),
|
||||
icon: const Icon(FontAwesomeIcons.solidClock, size: 19),
|
||||
onTap: () =>
|
||||
introController.handleAction(introController.viewLater),
|
||||
selectStatus: introController.hasLater.value,
|
||||
@@ -580,7 +575,7 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.shareFromSquare),
|
||||
icon: const Icon(BiliIcons.ugcvideo_ic_share),
|
||||
onTap: () => introController.actionShareVideo(context),
|
||||
selectStatus: false,
|
||||
text: !isLoading
|
||||
|
||||
@@ -7,7 +7,6 @@ class ActionItem extends StatelessWidget {
|
||||
const ActionItem({
|
||||
super.key,
|
||||
required this.icon,
|
||||
this.selectIcon,
|
||||
this.onTap,
|
||||
this.onLongPress,
|
||||
this.text,
|
||||
@@ -16,11 +15,9 @@ class ActionItem extends StatelessWidget {
|
||||
this.animation,
|
||||
this.onStartTriple,
|
||||
this.onCancelTriple,
|
||||
}) : assert(!selectStatus || selectIcon != null),
|
||||
_isThumbsUp = onStartTriple != null;
|
||||
}) : _isThumbsUp = onStartTriple != null;
|
||||
|
||||
final Icon icon;
|
||||
final Icon? selectIcon;
|
||||
final VoidCallback? onTap;
|
||||
final VoidCallback? onLongPress;
|
||||
final String? text;
|
||||
@@ -39,8 +36,8 @@ class ActionItem extends StatelessWidget {
|
||||
? colorScheme.inversePrimary
|
||||
: colorScheme.primary;
|
||||
Widget child = Icon(
|
||||
selectStatus ? selectIcon!.icon! : icon.icon,
|
||||
size: 18,
|
||||
icon.icon,
|
||||
size: icon.size ?? 20.5,
|
||||
color: selectStatus ? primary : icon.color ?? colorScheme.outline,
|
||||
);
|
||||
|
||||
@@ -51,8 +48,12 @@ class ActionItem extends StatelessWidget {
|
||||
children: [
|
||||
AnimatedBuilder(
|
||||
animation: animation!,
|
||||
builder: (context, child) =>
|
||||
Arc(size: 28, color: primary, progress: -animation!.value),
|
||||
builder: (context, child) => Arc(
|
||||
size: 28,
|
||||
color: primary,
|
||||
progress: -animation!.value,
|
||||
strokeWidth: 1.6,
|
||||
),
|
||||
),
|
||||
child,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user