@@ -231,83 +231,6 @@ Finder findTooltipContainer(String tooltipText) {
231231}
232232
233233void main () {
234- testWidgets ('M2 Chip defaults' , (WidgetTester tester) async {
235- late TextTheme textTheme;
236-
237- Widget buildFrame (Brightness brightness) {
238- return MaterialApp (
239- theme: ThemeData (brightness: brightness, useMaterial3: false ),
240- home: Scaffold (
241- body: Center (
242- child: Builder (
243- builder: (BuildContext context) {
244- textTheme = Theme .of (context).textTheme;
245- return Chip (
246- avatar: const CircleAvatar (child: Text ('A' )),
247- label: const Text ('Chip A' ),
248- onDeleted: () { },
249- );
250- },
251- ),
252- ),
253- ),
254- );
255- }
256-
257- await tester.pumpWidget (buildFrame (Brightness .light));
258- expect (getMaterialBox (tester), paints..rrect ()..circle (color: const Color (0xff1976d2 )));
259- expect (tester.getSize (find.byType (Chip )), const Size (156.0 , 48.0 ));
260- expect (getMaterial (tester).color, null );
261- expect (getMaterial (tester).elevation, 0 );
262- expect (getMaterial (tester).shape, const StadiumBorder ());
263- expect (getIconData (tester).color? .value, 0xffffffff );
264- expect (getIconData (tester).opacity, null );
265- expect (getIconData (tester).size, null );
266-
267- TextStyle labelStyle = getLabelStyle (tester, 'Chip A' ).style;
268- expect (labelStyle.color? .value, 0xde000000 );
269- expect (labelStyle.fontFamily, textTheme.bodyLarge? .fontFamily);
270- expect (labelStyle.fontFamilyFallback, textTheme.bodyLarge? .fontFamilyFallback);
271- expect (labelStyle.fontFeatures, textTheme.bodyLarge? .fontFeatures);
272- expect (labelStyle.fontSize, textTheme.bodyLarge? .fontSize);
273- expect (labelStyle.fontStyle, textTheme.bodyLarge? .fontStyle);
274- expect (labelStyle.fontWeight, textTheme.bodyLarge? .fontWeight);
275- expect (labelStyle.height, textTheme.bodyLarge? .height);
276- expect (labelStyle.inherit, textTheme.bodyLarge? .inherit);
277- expect (labelStyle.leadingDistribution, textTheme.bodyLarge? .leadingDistribution);
278- expect (labelStyle.letterSpacing, textTheme.bodyLarge? .letterSpacing);
279- expect (labelStyle.overflow, textTheme.bodyLarge? .overflow);
280- expect (labelStyle.textBaseline, textTheme.bodyLarge? .textBaseline);
281- expect (labelStyle.wordSpacing, textTheme.bodyLarge? .wordSpacing);
282-
283- await tester.pumpWidget (buildFrame (Brightness .dark));
284- await tester.pumpAndSettle (); // Theme transition animation
285- expect (getMaterialBox (tester), paints..rrect (color: const Color (0x1fffffff )));
286- expect (tester.getSize (find.byType (Chip )), const Size (156.0 , 48.0 ));
287- expect (getMaterial (tester).color, null );
288- expect (getMaterial (tester).elevation, 0 );
289- expect (getMaterial (tester).shape, const StadiumBorder ());
290- expect (getIconData (tester).color? .value, 0xffffffff );
291- expect (getIconData (tester).opacity, null );
292- expect (getIconData (tester).size, null );
293-
294- labelStyle = getLabelStyle (tester, 'Chip A' ).style;
295- expect (labelStyle.color? .value, 0xdeffffff );
296- expect (labelStyle.fontFamily, textTheme.bodyLarge? .fontFamily);
297- expect (labelStyle.fontFamilyFallback, textTheme.bodyLarge? .fontFamilyFallback);
298- expect (labelStyle.fontFeatures, textTheme.bodyLarge? .fontFeatures);
299- expect (labelStyle.fontSize, textTheme.bodyLarge? .fontSize);
300- expect (labelStyle.fontStyle, textTheme.bodyLarge? .fontStyle);
301- expect (labelStyle.fontWeight, textTheme.bodyLarge? .fontWeight);
302- expect (labelStyle.height, textTheme.bodyLarge? .height);
303- expect (labelStyle.inherit, textTheme.bodyLarge? .inherit);
304- expect (labelStyle.leadingDistribution, textTheme.bodyLarge? .leadingDistribution);
305- expect (labelStyle.letterSpacing, textTheme.bodyLarge? .letterSpacing);
306- expect (labelStyle.overflow, textTheme.bodyLarge? .overflow);
307- expect (labelStyle.textBaseline, textTheme.bodyLarge? .textBaseline);
308- expect (labelStyle.wordSpacing, textTheme.bodyLarge? .wordSpacing);
309- });
310-
311234 testWidgets ('M3 Chip defaults' , (WidgetTester tester) async {
312235 late TextTheme textTheme;
313236 final ThemeData lightTheme = ThemeData .light ();
@@ -4484,7 +4407,7 @@ void main() {
44844407 expect (box.size, equals (const Size (128 , 32.0 + 16.0 )));
44854408 expect (textBox.size, equals (const Size (56 , 14 )));
44864409 expect (iconBox.size, equals (const Size (18 , 18 )));
4487- expect (avatarBox.size, equals (const Size (24 , 24 )));
4410+ expect (avatarBox.size, equals (const Size (18 , 18 )));
44884411 expect (textBox.top, equals (17 ));
44894412 expect (box.bottom - textBox.bottom, equals (17 ));
44904413 expect (textBox.left, equals (372 ));
@@ -4499,7 +4422,7 @@ void main() {
44994422 expect (box.size, equals (const Size (128 , 60 )));
45004423 expect (textBox.size, equals (const Size (56 , 14 )));
45014424 expect (iconBox.size, equals (const Size (18 , 18 )));
4502- expect (avatarBox.size, equals (const Size (24 , 24 )));
4425+ expect (avatarBox.size, equals (const Size (18 , 18 )));
45034426 expect (textBox.top, equals (23 ));
45044427 expect (box.bottom - textBox.bottom, equals (23 ));
45054428 expect (textBox.left, equals (372 ));
@@ -4514,7 +4437,7 @@ void main() {
45144437 expect (box.size, equals (const Size (128 , 36 )));
45154438 expect (textBox.size, equals (const Size (56 , 14 )));
45164439 expect (iconBox.size, equals (const Size (18 , 18 )));
4517- expect (avatarBox.size, equals (const Size (24 , 24 )));
4440+ expect (avatarBox.size, equals (const Size (18 , 18 )));
45184441 expect (textBox.top, equals (11 ));
45194442 expect (box.bottom - textBox.bottom, equals (11 ));
45204443 expect (textBox.left, equals (372 ));
@@ -4531,7 +4454,7 @@ void main() {
45314454 expect (box.size, equals (const Size (128 , 36 )));
45324455 expect (textBox.size, equals (const Size (56 , 14 )));
45334456 expect (iconBox.size, equals (const Size (18 , 18 )));
4534- expect (avatarBox.size, equals (const Size (24 , 24 )));
4457+ expect (avatarBox.size, equals (const Size (18 , 18 )));
45354458 expect (textBox.top, equals (11 ));
45364459 expect (box.bottom - textBox.bottom, equals (11 ));
45374460 expect (textBox.left, equals (372 ));
@@ -5489,9 +5412,9 @@ void main() {
54895412 expect (getMaterial (tester).color, null );
54905413 expect (getMaterial (tester).elevation, 0 );
54915414 expect (getMaterial (tester).shape, const StadiumBorder ());
5492- expect (getIconData (tester).color? .value, 0xffffffff );
5415+ expect (getIconData (tester).color, const Color ( 0xdd000000 ) );
54935416 expect (getIconData (tester).opacity, null );
5494- expect (getIconData (tester).size, null );
5417+ expect (getIconData (tester).size, 18.0 );
54955418
54965419 TextStyle labelStyle = getLabelStyle (tester, 'Chip A' ).style;
54975420 expect (labelStyle.color? .value, 0xde000000 );
@@ -5518,7 +5441,7 @@ void main() {
55185441 expect (getMaterial (tester).shape, const StadiumBorder ());
55195442 expect (getIconData (tester).color? .value, 0xffffffff );
55205443 expect (getIconData (tester).opacity, null );
5521- expect (getIconData (tester).size, null );
5444+ expect (getIconData (tester).size, 18.0 );
55225445
55235446 labelStyle = getLabelStyle (tester, 'Chip A' ).style;
55245447 expect (labelStyle.color? .value, 0xdeffffff );
0 commit comments