Skip to content

Commit

Permalink
Fix ink highlight effect of RawChip (flutter#28653)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue authored and Hans Muller committed Mar 1, 2019
1 parent 604e9dc commit 1df28e8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/flutter/lib/src/material/chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1625,10 +1625,11 @@ class _RawChipState extends State<RawChip> with TickerProviderStateMixin<RawChip
animationDuration: pressedAnimationDuration,
shape: shape,
clipBehavior: widget.clipBehavior,
child: InkResponse(
child: InkWell(
onTap: canTap ? _handleTap : null,
onTapDown: canTap ? _handleTapDown : null,
onTapCancel: canTap ? _handleTapCancel : null,
customBorder: shape,
child: AnimatedBuilder(
animation: Listenable.merge(<Listenable>[selectController, enableController]),
builder: (BuildContext context, Widget child) {
Expand Down
15 changes: 15 additions & 0 deletions packages/flutter/test/material/chip_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1649,4 +1649,19 @@ void main() {
const Offset(4, 4),
]));
});

testWidgets('Chips should use InkWell instead of InkResponse.', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/28646
await tester.pumpWidget(
MaterialApp(
home: Material(
child: ActionChip(
onPressed: (){},
label: const Text('action chip'),
),
),
),
);
expect(find.byType(InkWell), findsOneWidget);
});
}

0 comments on commit 1df28e8

Please sign in to comment.