Fix ink highlight effect of RawChip (#28653)
This commit is contained in:
parent
604e9dc683
commit
1df28e8b7a
@ -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) {
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user