Flutter InkWell with Container as child is not showing effects

120

Solution 1

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

Solution 2

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

Wrap your InkWell in Material widget.

Share:
120
Chris
Author by

Chris

Updated on December 28, 2022

Comments

  • Chris
    Chris over 1 year

    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?