InkResponse enable if onTapDown is not null (#96224)
This commit is contained in:
@@ -1032,7 +1032,7 @@ class _InkResponseState extends State<_InkResponseStateWidget>
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -76,6 +76,26 @@ void main() {
|
||||
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>[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user