ripple method
Widget
ripple(
- Function? onPressed, {
- BorderRadiusGeometry borderRadius = const BorderRadius.all(Radius.circular(5)),
Implementation
Widget ripple(Function? onPressed,
{BorderRadiusGeometry borderRadius =
const BorderRadius.all(Radius.circular(5))}) =>
Stack(
children: <Widget>[
this,
Positioned(
left: 0,
right: 0,
top: 0,
bottom: 0,
child: TextButton(
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(borderRadius: borderRadius),
)),
onPressed: () {
if (onPressed != null) {
onPressed();
}
},
child: Container()),
)
],
);