mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
fix: 屏幕阅读器点击按钮无声
This commit is contained in:
@@ -3,12 +3,10 @@ import 'package:flutter/material.dart';
|
||||
class ComBtn extends StatelessWidget {
|
||||
final Widget? icon;
|
||||
final Function? fuc;
|
||||
final String tooltip;
|
||||
|
||||
const ComBtn({
|
||||
this.icon,
|
||||
this.fuc,
|
||||
required this.tooltip,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@@ -17,15 +15,11 @@ class ComBtn extends StatelessWidget {
|
||||
return SizedBox(
|
||||
width: 34,
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
tooltip: tooltip,
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
fuc!();
|
||||
},
|
||||
icon: icon!,
|
||||
child: icon!,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -66,25 +66,23 @@ class PlayOrPauseButtonState extends State<PlayOrPauseButton>
|
||||
return SizedBox(
|
||||
width: 42,
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
tooltip: widget.controller!.videoPlayerController!.state.playing
|
||||
? '暂停'
|
||||
: '播放',
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: player.playOrPause,
|
||||
color: Colors.white,
|
||||
iconSize: 25,
|
||||
child: InkWell(
|
||||
onTap: player.playOrPause,
|
||||
// iconSize: widget.iconSize ?? _theme(context).buttonBarButtonSize,
|
||||
// color: widget.iconColor ?? _theme(context).buttonBarButtonColor,
|
||||
icon: AnimatedIcon(
|
||||
progress: animation,
|
||||
icon: AnimatedIcons.play_pause,
|
||||
color: Colors.white,
|
||||
size: 20,
|
||||
// size: widget.iconSize ?? _theme(context).buttonBarButtonSize,
|
||||
// color: widget.iconColor ?? _theme(context).buttonBarButtonColor,
|
||||
child: Center(
|
||||
child: AnimatedIcon(
|
||||
semanticLabel:
|
||||
widget.controller!.videoPlayerController!.state.playing
|
||||
? '暂停'
|
||||
: '播放',
|
||||
progress: animation,
|
||||
icon: AnimatedIcons.play_pause,
|
||||
color: Colors.white,
|
||||
size: 20,
|
||||
// size: widget.iconSize ?? _theme(context).buttonBarButtonSize,
|
||||
// color: widget.iconColor ?? _theme(context).buttonBarButtonColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user