InkResponse enable if onTapDown is not null (#96224)
diff --git a/packages/flutter/lib/src/material/ink_well.dart b/packages/flutter/lib/src/material/ink_well.dart
index 919227a..5c13c05 100644
--- a/packages/flutter/lib/src/material/ink_well.dart
+++ b/packages/flutter/lib/src/material/ink_well.dart
@@ -1032,7 +1032,7 @@
}
bool _isWidgetEnabled(_InkResponseStateWidget widget) {
- return widget.onTap != null || widget.onDoubleTap != null || widget.onLongPress != null;
+ return widget.onTap != null || widget.onDoubleTap != null || widget.onLongPress != null || widget.onTapDown != null;
}
bool get enabled => _isWidgetEnabled(widget);
diff --git a/packages/flutter/test/material/ink_well_test.dart b/packages/flutter/test/material/ink_well_test.dart
index ade64fd..55d67a0 100644
--- a/packages/flutter/test/material/ink_well_test.dart
+++ b/packages/flutter/test/material/ink_well_test.dart
@@ -76,6 +76,26 @@
expect(log, equals(<String>['tap-down', 'tap-cancel']));
});
+ testWidgets('InkWell only onTapDown enables gestures', (WidgetTester tester) async {
+ // Regression test for https://github.com/flutter/flutter/issues/96030
+ bool downTapped = false;
+ await tester.pumpWidget(Directionality(
+ textDirection: TextDirection.ltr,
+ child: Material(
+ child: Center(
+ child: InkWell(
+ onTapDown: (TapDownDetails details) {
+ downTapped = true;
+ },
+ ),
+ ),
+ ),
+ ));
+
+ await tester.tap(find.byType(InkWell));
+ expect(downTapped, true);
+ });
+
testWidgets('InkWell invokes activation actions when expected', (WidgetTester tester) async {
final List<String> log = <String>[];