fabriziog
fabriziog

Reputation: 419

Use onTapUp event with Inkwell

Is it possible to run code on the onTapUp event in the inkwell widget, like I can on a GestureDetector? onTapUp event isn't available between the parameters while onTapDown and onTapCancel etc are, is it a bug? Is there some way I could use it?

Upvotes: 2

Views: 1028

Answers (2)

Junsu Cho
Junsu Cho

Reputation: 854

make custom class

for example

class CustomInkWell extends StatelessWidget{
  var onTabUp;
  CustomInkWell({this.onTabUp});
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTapUp: onTabUp,
      child: InkWell(
        //your code
      ),
    );
  }
}

Upvotes: 0

Karim Elghamry
Karim Elghamry

Reputation: 1421

InkWell doesn't have a onTapUp property. You can wrap InkWell with GestureDetector:

GestureDetector(
    onTapUp: () => youFunction(), // your function goes here
    child: InkWell(...),
);

Upvotes: 2

Related Questions