@@ -295,6 +295,7 @@ class InkResponse extends StatelessWidget {
295295 this .child,
296296 this .onTap,
297297 this .onTapDown,
298+ this .onTapUp,
298299 this .onTapCancel,
299300 this .onDoubleTap,
300301 this .onLongPress,
@@ -337,6 +338,10 @@ class InkResponse extends StatelessWidget {
337338 /// Called when the user taps down this part of the material.
338339 final GestureTapDownCallback ? onTapDown;
339340
341+ /// Called when the user releases a tap that was started on this part of the
342+ /// material. [onTap] is called immediately after.
343+ final GestureTapUpCallback ? onTapUp;
344+
340345 /// Called when the user cancels a tap that was started on this part of the
341346 /// material.
342347 final GestureTapCallback ? onTapCancel;
@@ -583,6 +588,7 @@ class InkResponse extends StatelessWidget {
583588 return _InkResponseStateWidget (
584589 onTap: onTap,
585590 onTapDown: onTapDown,
591+ onTapUp: onTapUp,
586592 onTapCancel: onTapCancel,
587593 onDoubleTap: onDoubleTap,
588594 onLongPress: onLongPress,
@@ -633,6 +639,7 @@ class _InkResponseStateWidget extends StatefulWidget {
633639 this .child,
634640 this .onTap,
635641 this .onTapDown,
642+ this .onTapUp,
636643 this .onTapCancel,
637644 this .onDoubleTap,
638645 this .onLongPress,
@@ -669,6 +676,7 @@ class _InkResponseStateWidget extends StatefulWidget {
669676 final Widget ? child;
670677 final GestureTapCallback ? onTap;
671678 final GestureTapDownCallback ? onTapDown;
679+ final GestureTapUpCallback ? onTapUp;
672680 final GestureTapCallback ? onTapCancel;
673681 final GestureTapCallback ? onDoubleTap;
674682 final GestureLongPressCallback ? onLongPress;
@@ -707,6 +715,7 @@ class _InkResponseStateWidget extends StatefulWidget {
707715 if (onDoubleTap != null ) 'double tap' ,
708716 if (onLongPress != null ) 'long press' ,
709717 if (onTapDown != null ) 'tap down' ,
718+ if (onTapUp != null ) 'tap up' ,
710719 if (onTapCancel != null ) 'tap cancel' ,
711720 ];
712721 properties.add (IterableProperty <String >('gestures' , gestures, ifEmpty: '<none>' ));
@@ -963,6 +972,10 @@ class _InkResponseState extends State<_InkResponseStateWidget>
963972 widget.onTapDown? .call (details);
964973 }
965974
975+ void _handleTapUp (TapUpDetails details) {
976+ widget.onTapUp? .call (details);
977+ }
978+
966979 void _startSplash ({TapDownDetails ? details, BuildContext ? context}) {
967980 assert (details != null || context != null );
968981
@@ -1106,6 +1119,7 @@ class _InkResponseState extends State<_InkResponseStateWidget>
11061119 onLongPress: widget.excludeFromSemantics || widget.onLongPress == null ? null : _simulateLongPress,
11071120 child: GestureDetector (
11081121 onTapDown: enabled ? _handleTapDown : null ,
1122+ onTapUp: enabled ? _handleTapUp : null ,
11091123 onTap: enabled ? _handleTap : null ,
11101124 onTapCancel: enabled ? _handleTapCancel : null ,
11111125 onDoubleTap: widget.onDoubleTap != null ? _handleDoubleTap : null ,
@@ -1214,6 +1228,7 @@ class InkWell extends InkResponse {
12141228 GestureTapCallback ? onDoubleTap,
12151229 GestureLongPressCallback ? onLongPress,
12161230 GestureTapDownCallback ? onTapDown,
1231+ GestureTapUpCallback ? onTapUp,
12171232 GestureTapCancelCallback ? onTapCancel,
12181233 ValueChanged <bool >? onHighlightChanged,
12191234 ValueChanged <bool >? onHover,
@@ -1240,6 +1255,7 @@ class InkWell extends InkResponse {
12401255 onDoubleTap: onDoubleTap,
12411256 onLongPress: onLongPress,
12421257 onTapDown: onTapDown,
1258+ onTapUp: onTapUp,
12431259 onTapCancel: onTapCancel,
12441260 onHighlightChanged: onHighlightChanged,
12451261 onHover: onHover,
0 commit comments