parent
2f6155bf18
commit
8d76d37f33
@ -575,7 +575,7 @@ class InputChip extends StatelessWidget
|
|||||||
this.deleteIconColor,
|
this.deleteIconColor,
|
||||||
this.deleteButtonTooltipMessage,
|
this.deleteButtonTooltipMessage,
|
||||||
this.onPressed,
|
this.onPressed,
|
||||||
this.pressElevation,
|
this.pressElevation = 8.0,
|
||||||
this.disabledColor,
|
this.disabledColor,
|
||||||
this.selectedColor,
|
this.selectedColor,
|
||||||
this.tooltip,
|
this.tooltip,
|
||||||
@ -731,7 +731,7 @@ class ChoiceChip extends StatelessWidget
|
|||||||
this.labelStyle,
|
this.labelStyle,
|
||||||
this.labelPadding,
|
this.labelPadding,
|
||||||
this.onSelected,
|
this.onSelected,
|
||||||
this.pressElevation,
|
this.pressElevation = 8.0,
|
||||||
@required this.selected,
|
@required this.selected,
|
||||||
this.selectedColor,
|
this.selectedColor,
|
||||||
this.disabledColor,
|
this.disabledColor,
|
||||||
@ -908,7 +908,7 @@ class FilterChip extends StatelessWidget
|
|||||||
this.labelPadding,
|
this.labelPadding,
|
||||||
this.selected = false,
|
this.selected = false,
|
||||||
@required this.onSelected,
|
@required this.onSelected,
|
||||||
this.pressElevation,
|
this.pressElevation = 8.0,
|
||||||
this.disabledColor,
|
this.disabledColor,
|
||||||
this.selectedColor,
|
this.selectedColor,
|
||||||
this.tooltip,
|
this.tooltip,
|
||||||
@ -1037,7 +1037,7 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip
|
|||||||
this.labelStyle,
|
this.labelStyle,
|
||||||
this.labelPadding,
|
this.labelPadding,
|
||||||
@required this.onPressed,
|
@required this.onPressed,
|
||||||
this.pressElevation,
|
this.pressElevation = 8.0,
|
||||||
this.tooltip,
|
this.tooltip,
|
||||||
this.shape,
|
this.shape,
|
||||||
this.clipBehavior = Clip.none,
|
this.clipBehavior = Clip.none,
|
||||||
|
@ -1403,6 +1403,79 @@ void main() {
|
|||||||
expect(deleted, true);
|
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 {
|
testWidgets('Chip elevation works correctly', (WidgetTester tester) async {
|
||||||
final ThemeData theme = ThemeData(
|
final ThemeData theme = ThemeData(
|
||||||
platform: TargetPlatform.android,
|
platform: TargetPlatform.android,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user