mod: 无障碍自定义操作适配

This commit is contained in:
orz12
2024-09-08 20:58:20 +08:00
committed by bggRGjQaUbCoE
parent 33beafbf87
commit e4319dae2f
3 changed files with 266 additions and 292 deletions

View File

@@ -1,4 +1,5 @@
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 '../../models/model_rec_video_item.dart';
@@ -127,10 +128,16 @@ 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!,
},
child: Card(
clipBehavior: Clip.hardEdge,
margin: EdgeInsets.zero,
@@ -185,7 +192,7 @@ class VideoCardV extends StatelessWidget {
child: VideoPopupMenu(
size: 29,
iconSize: 17,
videoItem: videoItem,
actions: actions,
)),
]);
}