这似乎行得通,我不知道这样做对不对,或者有没有更好的办法,但给你.
class Test extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Container(
color: Colors.blue,
child: Center(
child: GestureDetector(
onTap: () {
print('clicky');
},
child: ClipOval(
child: Container(
width: 200,
height: 200,
color: Colors.red,
),
),
),
),
),
);
}
}