Ask Your Question
1

How can the ripple effect of Inkwell be obscured by a child container filled with color in Flutter?

asked 2023-06-30 19:44:44 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-06-30 20:00:02 +0000

lakamha gravatar image

One way to obscure the ripple effect of Inkwell in Flutter is by adding a child container filled with color on top of the Inkwell. This will block the visibility of the ripple effect.

To do this, you can wrap the Inkwell widget in a Stack widget and then add a child container with the desired color as the first child of the Stack. This way, the Inkwell will be placed on top of the colored container, obscuring the ripple effect.

Here's an example code snippet:

Stack(
  children: [
    Container(
      color: Colors.blue, // or any other color
    ),
    InkWell(
      onTap: () {
        // Handle onTap event
      },
      child: Text('Tap me'),
    ),
  ],
)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-30 19:44:44 +0000

Seen: 10 times

Last updated: Jun 30 '23