@@ -288,12 +288,12 @@ class Style {
288288
289289 FontSize finalFontSize = child.fontSize != null ?
290290 fontSize != null && child.fontSize? .units == "em" ?
291- FontSize (child.fontSize.size * fontSize.size, "" ) : child.fontSize
291+ FontSize (child.fontSize.size * fontSize.size) : child.fontSize
292292 : fontSize != null && fontSize.size < 0 ?
293293 FontSize .percent (100 ) : fontSize;
294294 LineHeight finalLineHeight = child.lineHeight != null ?
295295 child.lineHeight? .units == "length" ?
296- LineHeight (child.lineHeight.size / (finalFontSize == null ? 14 : finalFontSize.size) * 1.2 , "" ) : child.lineHeight
296+ LineHeight (child.lineHeight.size / (finalFontSize == null ? 14 : finalFontSize.size) * 1.2 ) : child.lineHeight
297297 : lineHeight;
298298 return child.copyWith (
299299 color: child.color ?? color,
@@ -393,13 +393,13 @@ class Style {
393393 this .textDecorationThickness = textStyle.decorationThickness;
394394 this .fontFamily = textStyle.fontFamily;
395395 this .fontFeatureSettings = textStyle.fontFeatures;
396- this .fontSize = FontSize (textStyle.fontSize, "" );
396+ this .fontSize = FontSize (textStyle.fontSize);
397397 this .fontStyle = textStyle.fontStyle;
398398 this .fontWeight = textStyle.fontWeight;
399399 this .letterSpacing = textStyle.letterSpacing;
400400 this .textShadow = textStyle.shadows;
401401 this .wordSpacing = textStyle.wordSpacing;
402- this .lineHeight = LineHeight (textStyle.height ?? 1.2 , "" );
402+ this .lineHeight = LineHeight (textStyle.height ?? 1.2 );
403403 }
404404}
405405
@@ -415,19 +415,19 @@ class FontSize {
415415 final double size;
416416 final String units;
417417
418- const FontSize (this .size, this .units);
418+ const FontSize (this .size, { this .units = "" } );
419419
420420 /// A percentage of the parent style's font size.
421421 factory FontSize .percent (int percent) {
422- return FontSize (percent.toDouble () / - 100.0 , "%" );
422+ return FontSize (percent.toDouble () / - 100.0 , units : "%" );
423423 }
424424
425425 factory FontSize .em (double em) {
426- return FontSize (em, "em" );
426+ return FontSize (em, units : "em" );
427427 }
428428
429429 factory FontSize .rem (double rem) {
430- return FontSize (rem * 16 - 2 , "rem" );
430+ return FontSize (rem * 16 - 2 , units : "rem" );
431431 }
432432 // These values are calculated based off of the default (`medium`)
433433 // being 14px.
@@ -436,40 +436,40 @@ class FontSize {
436436 //
437437 // Negative values are computed during parsing to be a percentage of
438438 // the parent style's font size.
439- static const xxSmall = FontSize (7.875 , "" );
440- static const xSmall = FontSize (8.75 , "" );
441- static const small = FontSize (11.375 , "" );
442- static const medium = FontSize (14.0 , "" );
443- static const large = FontSize (15.75 , "" );
444- static const xLarge = FontSize (21.0 , "" );
445- static const xxLarge = FontSize (28.0 , "" );
446- static const smaller = FontSize (- 0.83 , "" );
447- static const larger = FontSize (- 1.2 , "" );
439+ static const xxSmall = FontSize (7.875 );
440+ static const xSmall = FontSize (8.75 );
441+ static const small = FontSize (11.375 );
442+ static const medium = FontSize (14.0 );
443+ static const large = FontSize (15.75 );
444+ static const xLarge = FontSize (21.0 );
445+ static const xxLarge = FontSize (28.0 );
446+ static const smaller = FontSize (- 0.83 );
447+ static const larger = FontSize (- 1.2 );
448448}
449449
450450class LineHeight {
451451 final double size;
452452 final String units;
453453
454- const LineHeight (this .size, this .units);
454+ const LineHeight (this .size, { this .units = "" } );
455455
456456 factory LineHeight .percent (double percent) {
457- return LineHeight (percent / 100.0 * 1.2 , "%" );
457+ return LineHeight (percent / 100.0 * 1.2 , units : "%" );
458458 }
459459
460460 factory LineHeight .em (double em) {
461- return LineHeight (em * 1.2 , "em" );
461+ return LineHeight (em * 1.2 , units : "em" );
462462 }
463463
464464 factory LineHeight .rem (double rem) {
465- return LineHeight (rem * 1.2 , "rem" );
465+ return LineHeight (rem * 1.2 , units : "rem" );
466466 }
467467
468468 factory LineHeight .number (double num ) {
469- return LineHeight (num * 1.2 , "number" );
469+ return LineHeight (num * 1.2 , units : "number" );
470470 }
471471
472- static const normal = LineHeight (1.2 , "" );
472+ static const normal = LineHeight (1.2 );
473473}
474474
475475enum ListStyleType {
0 commit comments