mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-17 07:36:14 +08:00
opt ugc intro
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -43,8 +43,8 @@ class VideoCardV extends StatelessWidget {
|
||||
PageUtils.toVideoPage(
|
||||
'bvid=$bvid&cid=$cid',
|
||||
arguments: {
|
||||
'pic': videoItem.cover,
|
||||
'heroTag': heroTag,
|
||||
'videoItem': videoItem,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -54,10 +54,11 @@ abstract class CommonIntroController extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> queryVideoTags() async {
|
||||
videoTags.value = null;
|
||||
var result = await UserHttp.videoTags(bvid: bvid);
|
||||
if (result['status']) {
|
||||
videoTags.value = result['data'];
|
||||
} else {
|
||||
videoTags.value = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +164,9 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
if (isLoading)
|
||||
_buildVideoTitle(theme, videoDetail)
|
||||
else
|
||||
ExpandablePanel(
|
||||
controller: introController.expandableCtr,
|
||||
collapsed: GestureDetector(
|
||||
@@ -508,8 +511,9 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
||||
handleState(videoIntroController.actionOneThree),
|
||||
selectStatus: videoIntroController.hasLike.value,
|
||||
semanticsLabel: '点赞',
|
||||
text:
|
||||
!isLoading ? NumUtil.numFormat(videoDetail.stat!.like!) : '-',
|
||||
text: !isLoading
|
||||
? NumUtil.numFormat(videoDetail.stat!.like!)
|
||||
: null,
|
||||
needAnim: true,
|
||||
hasTriple: videoIntroController.hasLike.value &&
|
||||
videoIntroController.hasCoin &&
|
||||
@@ -544,8 +548,9 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
||||
onTap: () => handleState(videoIntroController.actionCoinVideo),
|
||||
selectStatus: videoIntroController.hasCoin,
|
||||
semanticsLabel: '投币',
|
||||
text:
|
||||
!isLoading ? NumUtil.numFormat(videoDetail.stat!.coin!) : '-',
|
||||
text: !isLoading
|
||||
? NumUtil.numFormat(videoDetail.stat!.coin!)
|
||||
: null,
|
||||
needAnim: true,
|
||||
),
|
||||
),
|
||||
@@ -561,7 +566,7 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
||||
semanticsLabel: '收藏',
|
||||
text: !isLoading
|
||||
? NumUtil.numFormat(videoDetail.stat!.favorite!)
|
||||
: '-',
|
||||
: null,
|
||||
needAnim: true,
|
||||
),
|
||||
),
|
||||
@@ -581,7 +586,7 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
||||
selectStatus: false,
|
||||
semanticsLabel: '分享',
|
||||
text:
|
||||
!isLoading ? NumUtil.numFormat(videoDetail.stat!.share!) : '分享',
|
||||
!isLoading ? NumUtil.numFormat(videoDetail.stat!.share!) : null,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -121,16 +121,18 @@ class ActionItemState extends State<ActionItem>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return widget.expand == false
|
||||
? _buildItem(theme)
|
||||
: Expanded(child: _buildItem(theme));
|
||||
}
|
||||
|
||||
Widget _buildItem(ThemeData theme) => Semantics(
|
||||
label: (widget.text ?? "") +
|
||||
(widget.selectStatus ? "已" : "") +
|
||||
widget.semanticsLabel,
|
||||
child: Material(
|
||||
final hasText = widget.text != null;
|
||||
final text = Text(
|
||||
hasText ? widget.text! : '-',
|
||||
key: hasText ? ValueKey(widget.text!) : null,
|
||||
style: TextStyle(
|
||||
color: widget.selectStatus
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.outline,
|
||||
fontSize: theme.textTheme.labelSmall!.fontSize,
|
||||
),
|
||||
);
|
||||
final child = Material(
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
||||
@@ -178,27 +180,19 @@ class ActionItemState extends State<ActionItem>
|
||||
if (widget.text != null)
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
transitionBuilder:
|
||||
(Widget child, Animation<double> animation) {
|
||||
transitionBuilder: (Widget child, Animation<double> animation) {
|
||||
return ScaleTransition(scale: animation, child: child);
|
||||
},
|
||||
child: Text(
|
||||
widget.text!,
|
||||
key: ValueKey(widget.text!),
|
||||
style: TextStyle(
|
||||
color: widget.selectStatus
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.outline,
|
||||
fontSize: theme.textTheme.labelSmall!.fontSize,
|
||||
),
|
||||
semanticsLabel: "",
|
||||
),
|
||||
),
|
||||
child: text,
|
||||
)
|
||||
else
|
||||
text
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
return widget.expand == false ? child : Expanded(child: child);
|
||||
}
|
||||
}
|
||||
|
||||
class _ArcPainter extends CustomPainter {
|
||||
|
||||
Reference in New Issue
Block a user