2

I have a simple InkWell with a Container inside of it. I would like to have the ripple affect but it is not showing. Neither is hoverColor/focusColor...

My button:

class EntryNextButton extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () {
        print("Container clicked");
      },
      child: Container(
        ...
    );
  }
}

What am I missing here?

Chris
  • 1,828
  • 6
  • 40
  • 108

2 Answers2

1

The InkWell widget must have a Material widget as an ancestor.

Wrap your InkWell in Material widget.

Simon Sot
  • 2,748
  • 2
  • 10
  • 23
1

you should have a Scaffold or at least a Material as ancestor

Ahmed Masoud
  • 309
  • 3
  • 8