fix: 屏幕阅读器点击按钮无声

This commit is contained in:
orz12
2024-08-25 23:52:10 +08:00
parent a7bfd4b156
commit d2b8c01ac4
4 changed files with 31 additions and 39 deletions

View File

@@ -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!,
),
);
}