Flutter - Custom button tap area
This seems to work, I don't know if it is right to do so or if there is a better way but here you go.
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,
),
),
),
),
),
);
}
}
If you want the keep the splash during the tap, you can do something like this:
Material(
color: Colors.green,
shape: CircleBorder(),
elevation: 5.0,
child: InkWell(
borderRadius: BorderRadius.circular(100.0),
onTap: () => print("here"),
child: Container(
height: 200.0,
width: 200.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
),
child: Icon(Icons.receipt),
),
),
),