@@ -295,6 +295,7 @@ class InkResponse extends StatelessWidget {
295
295
this .child,
296
296
this .onTap,
297
297
this .onTapDown,
298
+ this .onTapUp,
298
299
this .onTapCancel,
299
300
this .onDoubleTap,
300
301
this .onLongPress,
@@ -337,6 +338,10 @@ class InkResponse extends StatelessWidget {
337
338
/// Called when the user taps down this part of the material.
338
339
final GestureTapDownCallback ? onTapDown;
339
340
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
+
340
345
/// Called when the user cancels a tap that was started on this part of the
341
346
/// material.
342
347
final GestureTapCallback ? onTapCancel;
@@ -583,6 +588,7 @@ class InkResponse extends StatelessWidget {
583
588
return _InkResponseStateWidget (
584
589
onTap: onTap,
585
590
onTapDown: onTapDown,
591
+ onTapUp: onTapUp,
586
592
onTapCancel: onTapCancel,
587
593
onDoubleTap: onDoubleTap,
588
594
onLongPress: onLongPress,
@@ -633,6 +639,7 @@ class _InkResponseStateWidget extends StatefulWidget {
633
639
this .child,
634
640
this .onTap,
635
641
this .onTapDown,
642
+ this .onTapUp,
636
643
this .onTapCancel,
637
644
this .onDoubleTap,
638
645
this .onLongPress,
@@ -669,6 +676,7 @@ class _InkResponseStateWidget extends StatefulWidget {
669
676
final Widget ? child;
670
677
final GestureTapCallback ? onTap;
671
678
final GestureTapDownCallback ? onTapDown;
679
+ final GestureTapUpCallback ? onTapUp;
672
680
final GestureTapCallback ? onTapCancel;
673
681
final GestureTapCallback ? onDoubleTap;
674
682
final GestureLongPressCallback ? onLongPress;
@@ -707,6 +715,7 @@ class _InkResponseStateWidget extends StatefulWidget {
707
715
if (onDoubleTap != null ) 'double tap' ,
708
716
if (onLongPress != null ) 'long press' ,
709
717
if (onTapDown != null ) 'tap down' ,
718
+ if (onTapUp != null ) 'tap up' ,
710
719
if (onTapCancel != null ) 'tap cancel' ,
711
720
];
712
721
properties.add (IterableProperty <String >('gestures' , gestures, ifEmpty: '<none>' ));
@@ -963,6 +972,10 @@ class _InkResponseState extends State<_InkResponseStateWidget>
963
972
widget.onTapDown? .call (details);
964
973
}
965
974
975
+ void _handleTapUp (TapUpDetails details) {
976
+ widget.onTapUp? .call (details);
977
+ }
978
+
966
979
void _startSplash ({TapDownDetails ? details, BuildContext ? context}) {
967
980
assert (details != null || context != null );
968
981
@@ -1106,6 +1119,7 @@ class _InkResponseState extends State<_InkResponseStateWidget>
1106
1119
onLongPress: widget.excludeFromSemantics || widget.onLongPress == null ? null : _simulateLongPress,
1107
1120
child: GestureDetector (
1108
1121
onTapDown: enabled ? _handleTapDown : null ,
1122
+ onTapUp: enabled ? _handleTapUp : null ,
1109
1123
onTap: enabled ? _handleTap : null ,
1110
1124
onTapCancel: enabled ? _handleTapCancel : null ,
1111
1125
onDoubleTap: widget.onDoubleTap != null ? _handleDoubleTap : null ,
@@ -1214,6 +1228,7 @@ class InkWell extends InkResponse {
1214
1228
GestureTapCallback ? onDoubleTap,
1215
1229
GestureLongPressCallback ? onLongPress,
1216
1230
GestureTapDownCallback ? onTapDown,
1231
+ GestureTapUpCallback ? onTapUp,
1217
1232
GestureTapCancelCallback ? onTapCancel,
1218
1233
ValueChanged <bool >? onHighlightChanged,
1219
1234
ValueChanged <bool >? onHover,
@@ -1240,6 +1255,7 @@ class InkWell extends InkResponse {
1240
1255
onDoubleTap: onDoubleTap,
1241
1256
onLongPress: onLongPress,
1242
1257
onTapDown: onTapDown,
1258
+ onTapUp: onTapUp,
1243
1259
onTapCancel: onTapCancel,
1244
1260
onHighlightChanged: onHighlightChanged,
1245
1261
onHover: onHover,
0 commit comments