mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -1,6 +1,5 @@
|
||||
import 'package:PiliPalaX/common/widgets/image_save.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../http/search.dart';
|
||||
@@ -42,18 +41,16 @@ class VideoCardH extends StatelessWidget {
|
||||
try {
|
||||
type = videoItem.type;
|
||||
} catch (_) {}
|
||||
List<VideoCustomAction> actions =
|
||||
VideoCustomActions(videoItem, context).actions;
|
||||
final String heroTag = Utils.makeHeroTag(aid);
|
||||
return Stack(children: [
|
||||
Semantics(
|
||||
label: Utils.videoItemSemantics(videoItem),
|
||||
excludeSemantics: true,
|
||||
customSemanticsActions: <CustomSemanticsAction, void Function()>{
|
||||
for (var item in actions)
|
||||
CustomSemanticsAction(
|
||||
label: item.title.isEmpty ? 'label' : item.title): item.onTap!,
|
||||
},
|
||||
// customSemanticsActions: <CustomSemanticsAction, void Function()>{
|
||||
// for (var item in actions)
|
||||
// CustomSemanticsAction(
|
||||
// label: item.title.isEmpty ? 'label' : item.title): item.onTap!,
|
||||
// },
|
||||
child: InkWell(
|
||||
onLongPress: () {
|
||||
if (onLongPress != null) {
|
||||
@@ -152,7 +149,7 @@ class VideoCardH extends StatelessWidget {
|
||||
child: VideoPopupMenu(
|
||||
size: 29,
|
||||
iconSize: 17,
|
||||
actions: actions,
|
||||
videoItem: videoItem,
|
||||
),
|
||||
),
|
||||
]);
|
||||
|
||||
@@ -110,7 +110,7 @@ class VideoCardHMemberVideo extends StatelessWidget {
|
||||
child: VideoPopupMenu(
|
||||
size: 29,
|
||||
iconSize: 17,
|
||||
actions: VideoCustomActions(videoItem, context).actions,
|
||||
videoItem: videoItem,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -145,16 +145,14 @@ class VideoCardV extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String heroTag = Utils.makeHeroTag(videoItem.id);
|
||||
List<VideoCustomAction> actions =
|
||||
VideoCustomActions(videoItem, context).actions;
|
||||
return Stack(children: [
|
||||
Semantics(
|
||||
label: Utils.videoItemSemantics(videoItem),
|
||||
excludeSemantics: true,
|
||||
customSemanticsActions: <CustomSemanticsAction, void Function()>{
|
||||
for (var item in actions)
|
||||
CustomSemanticsAction(label: item.title): item.onTap!,
|
||||
},
|
||||
// customSemanticsActions: <CustomSemanticsAction, void Function()>{
|
||||
// for (var item in actions)
|
||||
// CustomSemanticsAction(label: item.title): item.onTap!,
|
||||
// },
|
||||
child: Card(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
margin: EdgeInsets.zero,
|
||||
@@ -204,13 +202,14 @@ class VideoCardV extends StatelessWidget {
|
||||
),
|
||||
if (videoItem.goto == 'av')
|
||||
Positioned(
|
||||
right: -5,
|
||||
bottom: -2,
|
||||
child: VideoPopupMenu(
|
||||
size: 29,
|
||||
iconSize: 17,
|
||||
actions: actions,
|
||||
)),
|
||||
right: -5,
|
||||
bottom: -2,
|
||||
child: VideoPopupMenu(
|
||||
size: 29,
|
||||
iconSize: 17,
|
||||
videoItem: videoItem,
|
||||
),
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -270,14 +270,14 @@ class VideoCustomActions {
|
||||
class VideoPopupMenu extends StatelessWidget {
|
||||
final double? size;
|
||||
final double? iconSize;
|
||||
final List<VideoCustomAction> actions;
|
||||
final double menuItemHeight = 45;
|
||||
final dynamic videoItem;
|
||||
|
||||
const VideoPopupMenu({
|
||||
super.key,
|
||||
required this.size,
|
||||
required this.iconSize,
|
||||
required this.actions,
|
||||
required this.videoItem,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -295,7 +295,8 @@ class VideoPopupMenu extends StatelessWidget {
|
||||
),
|
||||
position: PopupMenuPosition.under,
|
||||
onSelected: (String type) {},
|
||||
itemBuilder: (BuildContext context) => actions.map((e) {
|
||||
itemBuilder: (BuildContext context) =>
|
||||
VideoCustomActions(videoItem, context).actions.map((e) {
|
||||
return PopupMenuItem<String>(
|
||||
value: e.value,
|
||||
height: menuItemHeight,
|
||||
|
||||
Reference in New Issue
Block a user