skip to Main Content

PROBLEM:
How we can disable color for inkwell so that if we click on it nothing shows up but click should work as it is?

2

Answers


  1. Chosen as BEST ANSWER

    SOLUTION:
    Just pass transparent color in 2 properties of Inkwell

    1. highlightColor
    2. splashColor

    Now if you click there will be no color but onTap will work.

               InkWell(
                        highlightColor: Colors.transparent,
                        splashColor: Colors.transparent,
                        onTap: () {
                          print("Hello D");
                        },
                        child: Container(
                        ),
    

  2. Or even simpler you can use a GestureDetector class

    ...
    GestureDetector(
        onTap: () => doSomething(),
        child: Text("click here"),
    )
    ...
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search