fix: disable onTap when quick action button is disabled (#4713)

This commit is contained in:
Richard Shiue 2024-02-23 16:56:31 +08:00 committed by GitHub
parent 746f0817bc
commit acd75befbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,7 +25,11 @@ class MobileQuickActionButton extends StatelessWidget {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 4), padding: const EdgeInsets.symmetric(horizontal: 4),
child: InkWell( child: InkWell(
onTap: onTap, onTap: () {
if (enable) {
onTap();
}
},
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
overlayColor: overlayColor:
enable ? null : const MaterialStatePropertyAll(Colors.transparent), enable ? null : const MaterialStatePropertyAll(Colors.transparent),