@@ -288,12 +288,12 @@ class Style {
288
288
289
289
FontSize finalFontSize = child.fontSize != null ?
290
290
fontSize != null && child.fontSize? .units == "em" ?
291
- FontSize (child.fontSize.size * fontSize.size, "" ) : child.fontSize
291
+ FontSize (child.fontSize.size * fontSize.size) : child.fontSize
292
292
: fontSize != null && fontSize.size < 0 ?
293
293
FontSize .percent (100 ) : fontSize;
294
294
LineHeight finalLineHeight = child.lineHeight != null ?
295
295
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
297
297
: lineHeight;
298
298
return child.copyWith (
299
299
color: child.color ?? color,
@@ -393,13 +393,13 @@ class Style {
393
393
this .textDecorationThickness = textStyle.decorationThickness;
394
394
this .fontFamily = textStyle.fontFamily;
395
395
this .fontFeatureSettings = textStyle.fontFeatures;
396
- this .fontSize = FontSize (textStyle.fontSize, "" );
396
+ this .fontSize = FontSize (textStyle.fontSize);
397
397
this .fontStyle = textStyle.fontStyle;
398
398
this .fontWeight = textStyle.fontWeight;
399
399
this .letterSpacing = textStyle.letterSpacing;
400
400
this .textShadow = textStyle.shadows;
401
401
this .wordSpacing = textStyle.wordSpacing;
402
- this .lineHeight = LineHeight (textStyle.height ?? 1.2 , "" );
402
+ this .lineHeight = LineHeight (textStyle.height ?? 1.2 );
403
403
}
404
404
}
405
405
@@ -415,19 +415,19 @@ class FontSize {
415
415
final double size;
416
416
final String units;
417
417
418
- const FontSize (this .size, this .units);
418
+ const FontSize (this .size, { this .units = "" } );
419
419
420
420
/// A percentage of the parent style's font size.
421
421
factory FontSize .percent (int percent) {
422
- return FontSize (percent.toDouble () / - 100.0 , "%" );
422
+ return FontSize (percent.toDouble () / - 100.0 , units : "%" );
423
423
}
424
424
425
425
factory FontSize .em (double em) {
426
- return FontSize (em, "em" );
426
+ return FontSize (em, units : "em" );
427
427
}
428
428
429
429
factory FontSize .rem (double rem) {
430
- return FontSize (rem * 16 - 2 , "rem" );
430
+ return FontSize (rem * 16 - 2 , units : "rem" );
431
431
}
432
432
// These values are calculated based off of the default (`medium`)
433
433
// being 14px.
@@ -436,40 +436,40 @@ class FontSize {
436
436
//
437
437
// Negative values are computed during parsing to be a percentage of
438
438
// 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 );
448
448
}
449
449
450
450
class LineHeight {
451
451
final double size;
452
452
final String units;
453
453
454
- const LineHeight (this .size, this .units);
454
+ const LineHeight (this .size, { this .units = "" } );
455
455
456
456
factory LineHeight .percent (double percent) {
457
- return LineHeight (percent / 100.0 * 1.2 , "%" );
457
+ return LineHeight (percent / 100.0 * 1.2 , units : "%" );
458
458
}
459
459
460
460
factory LineHeight .em (double em) {
461
- return LineHeight (em * 1.2 , "em" );
461
+ return LineHeight (em * 1.2 , units : "em" );
462
462
}
463
463
464
464
factory LineHeight .rem (double rem) {
465
- return LineHeight (rem * 1.2 , "rem" );
465
+ return LineHeight (rem * 1.2 , units : "rem" );
466
466
}
467
467
468
468
factory LineHeight .number (double num ) {
469
- return LineHeight (num * 1.2 , "number" );
469
+ return LineHeight (num * 1.2 , units : "number" );
470
470
}
471
471
472
- static const normal = LineHeight (1.2 , "" );
472
+ static const normal = LineHeight (1.2 );
473
473
}
474
474
475
475
enum ListStyleType {
0 commit comments