Unverified Commit 8d76d37f authored by jslavitz's avatar jslavitz Committed by GitHub

Choice Chip Fix (#22589)

* choice chip fix

* added test
parent 2f6155bf
......@@ -575,7 +575,7 @@ class InputChip extends StatelessWidget
this.deleteIconColor,
this.deleteButtonTooltipMessage,
this.onPressed,
this.pressElevation,
this.pressElevation = 8.0,
this.disabledColor,
this.selectedColor,
this.tooltip,
......@@ -731,7 +731,7 @@ class ChoiceChip extends StatelessWidget
this.labelStyle,
this.labelPadding,
this.onSelected,
this.pressElevation,
this.pressElevation = 8.0,
@required this.selected,
this.selectedColor,
this.disabledColor,
......@@ -908,7 +908,7 @@ class FilterChip extends StatelessWidget
this.labelPadding,
this.selected = false,
@required this.onSelected,
this.pressElevation,
this.pressElevation = 8.0,
this.disabledColor,
this.selectedColor,
this.tooltip,
......@@ -1037,7 +1037,7 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip
this.labelStyle,
this.labelPadding,
@required this.onPressed,
this.pressElevation,
this.pressElevation = 8.0,
this.tooltip,
this.shape,
this.clipBehavior = Clip.none,
......
......@@ -1403,6 +1403,79 @@ void main() {
expect(deleted, true);
});
testWidgets('Chips can be tapped', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Material(
child: ChoiceChip(
selected: false,
label: Text('choice chip'),
),
),
),
);
await tester.tap(find.byType(ChoiceChip));
expect(tester.takeException(), null);
await tester.pumpWidget(
const MaterialApp(
home: Material(
child: RawChip(
selected: false,
label: Text('raw chip'),
),
),
),
);
await tester.tap(find.byType(RawChip));
expect(tester.takeException(), null);
await tester.pumpWidget(
MaterialApp(
home: Material(
child: ActionChip(
onPressed: (){},
label: const Text('action chip'),
),
),
),
);
await tester.tap(find.byType(ActionChip));
expect(tester.takeException(), null);
await tester.pumpWidget(
MaterialApp(
home: Material(
child: FilterChip(
onSelected: (bool valueChanged){},
selected: false,
label: const Text('filter chip'),
),
),
),
);
await tester.tap(find.byType(FilterChip));
expect(tester.takeException(), null);
await tester.pumpWidget(
const MaterialApp(
home: Material(
child: InputChip(
selected: false,
label: Text('input chip'),
),
),
),
);
await tester.tap(find.byType(InputChip));
expect(tester.takeException(), null);
});
testWidgets('Chip elevation works correctly', (WidgetTester tester) async {
final ThemeData theme = ThemeData(
platform: TargetPlatform.android,
......
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