Search code examples
flutterwidgetgesturedetector

What is the difference between Ink and GestureDetector?


When I looked at the example of Ink and GestureDetector, I found that they are providing similar effects.

Could I say that Ink is just a child of GestureDetector, which detects onTap() only ?


Solution

    • Ink does not have onTap but InkWell does.
    • Ink is not a child of GestureDetector (w.r.t. OOPS).
    • InkWell and GestureDetector have common attributes but they are different.
    • GestureDetectors are roughly InkWells without ink splashes.
    • InkWells are roughly GestureDetectors without fancy gesture detections.

    In short, they are two different widgets with some common attributes.

    Further reads:
    Ink
    InkWell
    GestureDetector