Unverified Commit 63e30480 authored by Justin McCandless's avatar Justin McCandless Committed by GitHub

Add secondary tap capabilities to TableRowInkWell (#123036)

Added new parameters onSecondaryTap and onSecondaryTapDown
parent a5fc8b2b
......@@ -1189,6 +1189,8 @@ class TableRowInkWell extends InkResponse {
super.onDoubleTap,
super.onLongPress,
super.onHighlightChanged,
super.onSecondaryTap,
super.onSecondaryTapDown,
super.overlayColor,
super.mouseCursor,
}) : super(
......
......@@ -2070,6 +2070,51 @@ void main() {
e.toString().contains('dataRowHeight == null || (dataRowMinHeight == null && dataRowMaxHeight == null)'))));
});
group('TableRowInkWell', () {
testWidgets('can handle secondary taps', (WidgetTester tester) async {
bool secondaryTapped = false;
bool secondaryTappedDown = false;
await tester.pumpWidget(MaterialApp(
home: Material(
child: Table(
children: <TableRow>[
TableRow(
children: <Widget>[
TableRowInkWell(
onSecondaryTap: () {
secondaryTapped = true;
},
onSecondaryTapDown: (TapDownDetails details) {
secondaryTappedDown = true;
},
child: const SizedBox(
width: 100.0,
height: 100.0,
),
),
],
),
],
),
),
));
expect(secondaryTapped, isFalse);
expect(secondaryTappedDown, isFalse);
expect(find.byType(TableRowInkWell), findsOneWidget);
await tester.tap(
find.byType(TableRowInkWell),
buttons: kSecondaryMouseButton,
);
await tester.pumpAndSettle();
expect(secondaryTapped, isTrue);
expect(secondaryTappedDown, isTrue);
});
});
testWidgets('Heading cell cursor resolves MaterialStateMouseCursor correctly', (WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
......@@ -2233,5 +2278,4 @@ void main() {
// Test that cursor is updated for the row.
expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.copy);
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment