I have a GestureDetector in flutter which is responsible for detection of different user gesture. but my problem is that how can I provide splash and highLight color for that ?
Use InkWell widget insteadof GestureDetector.
You could use an InkWell as the child of your GestureDetector like this:
GestureDetector(
onHorizontalDragEnd: (details)
{
//
},
child: InkWell(
onTap: ()
{
//
},
highlightColor: yourColor,
splashColor: anotherColor,
),
This way you get the splash from the InkWell and can react to all the other gestures with the GestureDetector. The splash doesn't extend to the other gestures, so if the userinput leads to a another gesture (drag or whatever) then the splash is gone. Still this was good enough for me, the user can see there is a possible interaction with the ui-element. (Also use Inks instead of containers to not cover the splash.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With