StrutStyle constructor

const StrutStyle(
  1. {String fontFamily,
  2. List<String> fontFamilyFallback,
  3. double fontSize,
  4. double height,
  5. double leading,
  6. FontWeight fontWeight,
  7. FontStyle fontStyle,
  8. bool forceStrutHeight,
  9. String debugLabel,
  10. String package}
)

Creates a strut style.

The package argument must be non-null if the font family is defined in a package. It is combined with the fontFamily argument to set the fontFamily property.

If provided, fontSize must be positive and non-zero, leading must be zero or positive.

Implementation

const StrutStyle({
  String fontFamily,
  List<String> fontFamilyFallback,
  this.fontSize,
  this.height,
  this.leading,
  this.fontWeight,
  this.fontStyle,
  this.forceStrutHeight,
  this.debugLabel,
  String package,
}) : fontFamily = package == null ? fontFamily : 'packages/$package/$fontFamily',
     _fontFamilyFallback = fontFamilyFallback,
     _package = package,
     assert(fontSize == null || fontSize > 0),
     assert(leading == null || leading >= 0),
     assert(package == null || (package != null && (fontFamily != null || fontFamilyFallback != null)));