Flutter : Difference between InkWell and InkResponse?

Viewed 4928

I am Relatively new to Flutter Development, and while i was learning i came across the Ink Widgets that responds to touches while also showing some animation splash effect.

But, there are two almost similar type of widgets that is InkWell and InkResponse.

I could not find proper difference between those two from its class properties.

So, Can somebody explain what is the Main Difference between those two and, in which scenario i can use them.

Thanks.

2 Answers

I guess the 2 main differences between them are :

  1. they both make a splash but InkWell is for rectangular shapes only while InkResponse can be clipped.
  2. when the splash starts in InkWell but InkResponse will move the splash center to the child center .

last but not least and that's some thing am not sure of that the InkResponse deliver a Material widget with it's child but InkWell doesn't .

InkResponse does two things when responding to a tap:

1, It starts to animate a highlight -> Default is Circle in center.

2, It starts to animate a splash.

InkResponse

InlWell is a InkResponse with the highlight is a rectangle the size of the box.

InlWell

Related