点击事件

This commit is contained in:
toly
2023-05-01 19:31:47 +08:00
parent 66b3a7946a
commit 2b438bbbbe
2 changed files with 22 additions and 5 deletions

View File

@@ -2,15 +2,19 @@ import 'package:flutter/material.dart';
class MuyuAssetsImage extends StatelessWidget {
final String image;
final VoidCallback onTap;
const MuyuAssetsImage({super.key, required this.image});
const MuyuAssetsImage({super.key, required this.image, required this.onTap});
@override
Widget build(BuildContext context) {
return Center(
child: Image.asset(
image,
height: 200,
child: GestureDetector(
onTap: onTap,
child: Image.asset(
image,
height: 200,
),
),
);
}