diff --git a/lib/pages/bangumi/widgets/bangumi_panel.dart b/lib/pages/bangumi/widgets/bangumi_panel.dart index a6ca719f..17bc4b30 100644 --- a/lib/pages/bangumi/widgets/bangumi_panel.dart +++ b/lib/pages/bangumi/widgets/bangumi_panel.dart @@ -117,9 +117,10 @@ class _BangumiPanelState extends State { dense: false, leading: index == currentIndex ? Image.asset( - 'assets/images/live.gif', + 'assets/images/live.png', color: Theme.of(context).colorScheme.primary, height: 12, + semanticLabel: "正在播放:", ) : null, title: Text( @@ -135,6 +136,7 @@ class _BangumiPanelState extends State { ? Image.asset( 'assets/images/big-vip.png', height: 20, + semanticLabel: "大会员", ) : const SizedBox(), ), @@ -241,6 +243,7 @@ class _BangumiPanelState extends State { 'assets/images/live.png', color: Theme.of(context).colorScheme.primary, height: 12, + semanticLabel: "正在播放:", ), const SizedBox(width: 6) ], @@ -260,6 +263,7 @@ class _BangumiPanelState extends State { Image.asset( 'assets/images/big-vip.png', height: 16, + semanticLabel: "大会员", ), ], if (widget.pages[i].badge != '会员') ...[ diff --git a/lib/pages/live/widgets/live_item.dart b/lib/pages/live/widgets/live_item.dart index cc06868a..49ccc14c 100644 --- a/lib/pages/live/widgets/live_item.dart +++ b/lib/pages/live/widgets/live_item.dart @@ -165,10 +165,12 @@ class VideoStat extends StatelessWidget { Text( liveItem!.areaName!, style: const TextStyle(fontSize: 11, color: Colors.white), + semanticsLabel: "${liveItem!.areaName!}直播", ), Text( liveItem!.watchedShow!['text_small'], style: const TextStyle(fontSize: 11, color: Colors.white), + semanticsLabel: "${liveItem!.watchedShow!['text_small']}围观", ), ], ), diff --git a/lib/pages/mine/view.dart b/lib/pages/mine/view.dart index e91436ea..e347e9de 100644 --- a/lib/pages/mine/view.dart +++ b/lib/pages/mine/view.dart @@ -151,7 +151,7 @@ class _MinePageState extends State { semanticsLabel: '头像', width: 85, height: 85) - : Image.asset('assets/images/noface.jpeg'), + : Image.asset('assets/images/noface.jpeg',semanticLabel: "默认头像",), ), ), ), diff --git a/lib/pages/search_panel/widgets/user_panel.dart b/lib/pages/search_panel/widgets/user_panel.dart index 0504180f..3596f7b7 100644 --- a/lib/pages/search_panel/widgets/user_panel.dart +++ b/lib/pages/search_panel/widgets/user_panel.dart @@ -50,6 +50,7 @@ Widget searchUserPanel(BuildContext context, ctr, list) { Image.asset( 'assets/images/lv/lv${i!.level}.png', height: 11, + semanticLabel: '等级${i.level}', ), ], ), diff --git a/lib/pages/video/detail/introduction/widgets/page.dart b/lib/pages/video/detail/introduction/widgets/page.dart index ab0172e5..295395f2 100644 --- a/lib/pages/video/detail/introduction/widgets/page.dart +++ b/lib/pages/video/detail/introduction/widgets/page.dart @@ -144,11 +144,12 @@ class _PagesPanelState extends State { dense: false, leading: index == currentIndex ? Image.asset( - 'assets/images/live.gif', + 'assets/images/live.png', color: Theme.of(context) .colorScheme .primary, height: 12, + semanticLabel: "正在播放:", ) : null, title: Text( @@ -209,9 +210,10 @@ class _PagesPanelState extends State { children: [ if (i == currentIndex) ...[ Image.asset( - 'assets/images/live.gif', + 'assets/images/live.png', color: Theme.of(context).colorScheme.primary, height: 12, + semanticLabel: "正在播放:", ), const SizedBox(width: 6) ], diff --git a/lib/pages/video/detail/introduction/widgets/season.dart b/lib/pages/video/detail/introduction/widgets/season.dart index fabc366a..6e657411 100644 --- a/lib/pages/video/detail/introduction/widgets/season.dart +++ b/lib/pages/video/detail/introduction/widgets/season.dart @@ -157,6 +157,7 @@ class _SeasonPanelState extends State { .colorScheme .primary, height: 12, + semanticLabel: "正在播放:", ) : null, title: Text( @@ -169,9 +170,6 @@ class _SeasonPanelState extends State { .colorScheme .onSurface, ), - semanticsLabel: index == currentIndex - ? '当前播放:${episodes![index].title!}' - : null, ), ), itemScrollController: itemScrollController, @@ -197,9 +195,10 @@ class _SeasonPanelState extends State { ), const SizedBox(width: 15), Image.asset( - 'assets/images/live.gif', + 'assets/images/live.png', color: Theme.of(context).colorScheme.primary, height: 12, + semanticLabel: "正在播放:", ), const SizedBox(width: 10), Text( diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 29f043ca..2a43ad30 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -121,6 +121,7 @@ class ReplyItem extends StatelessWidget { child: Image.asset( 'assets/images/big-vip.png', height: 14, + semanticLabel: "大会员", ), ), ), @@ -168,6 +169,7 @@ class ReplyItem extends StatelessWidget { Image.asset( 'assets/images/lv/lv${replyItem!.member!.level}.png', height: 11, + semanticLabel: "等级:${replyItem!.member!.level}", ), const SizedBox(width: 6), if (replyItem!.isUp!) diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index 70d1119f..4ebb0553 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -740,6 +740,7 @@ class _PLVideoPlayerState extends State child: Image.asset( 'assets/images/loading.gif', height: 25, + semanticLabel: "加载中", ), ), ); diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 36ee8086..32ee19e0 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -95,7 +95,8 @@ class Utils { if (videoItem.rcmdReason != null && videoItem.rcmdReason.content != '') { semanticsLabel += ',${videoItem.rcmdReason.content}'; } - if (!emptyStatCheck(videoItem.duration)) { + if (!emptyStatCheck(videoItem.duration) && + (videoItem.duration is! int || videoItem.duration > 0)) { semanticsLabel += ',时长${Utils.durationReadFormat(Utils.timeFormat(videoItem.duration))}'; } @@ -107,9 +108,9 @@ class Utils { if (videoItem.owner.name != '') { semanticsLabel += ',Up主:${videoItem.owner.name}'; } - if (videoItem.runtimeType.toString() == "RecVideoItemAppModel" || - videoItem.runtimeType.toString() == "RecVideoItemModel" && - videoItem.isFollowed == 1) { + if ((videoItem.runtimeType.toString() == "RecVideoItemAppModel" || + videoItem.runtimeType.toString() == "RecVideoItemModel") && + videoItem.isFollowed == 1) { semanticsLabel += ',已关注'; } return semanticsLabel;