MacosTypography constructor

MacosTypography({
  1. required Color color,
  2. TextStyle? largeTitle,
  3. TextStyle? title1,
  4. TextStyle? title2,
  5. TextStyle? title3,
  6. TextStyle? headline,
  7. TextStyle? subheadline,
  8. TextStyle? body,
  9. TextStyle? callout,
  10. TextStyle? footnote,
  11. TextStyle? caption1,
  12. TextStyle? caption2,
})

Creates a typography that uses the given values.

Rather than creating a new typography, consider using MacosTypography.black or MacosTypography.white.

If you do decide to create your own typography, consider using one of those predefined themes as a starting point for copyWith.

Implementation

factory MacosTypography({
  required Color color,
  TextStyle? largeTitle,
  TextStyle? title1,
  TextStyle? title2,
  TextStyle? title3,
  TextStyle? headline,
  TextStyle? subheadline,
  TextStyle? body,
  TextStyle? callout,
  TextStyle? footnote,
  TextStyle? caption1,
  TextStyle? caption2,
}) {
  largeTitle ??= TextStyle(
    fontFamily: _kDefaultFontFamily,
    fontWeight: FontWeight.w400,
    fontSize: 26,
    letterSpacing: 0.22,
    color: color,
  );
  title1 ??= TextStyle(
    fontFamily: _kDefaultFontFamily,
    fontWeight: FontWeight.w400,
    fontSize: 22,
    letterSpacing: -0.26,
    color: color,
  );
  title2 ??= TextStyle(
    fontFamily: _kDefaultFontFamily,
    fontWeight: FontWeight.w400,
    fontSize: 17,
    letterSpacing: -0.43,
    color: color,
  );
  title3 ??= TextStyle(
    fontFamily: _kDefaultFontFamily,
    fontWeight: FontWeight.w400,
    fontSize: 15,
    letterSpacing: -0.23,
    color: color,
  );
  headline ??= TextStyle(
    fontFamily: _kDefaultFontFamily,
    fontWeight: FontWeight.w400,
    fontSize: 13,
    letterSpacing: -0.08,
    color: color,
  );
  subheadline ??= TextStyle(
    fontFamily: _kDefaultFontFamily,
    fontWeight: FontWeight.w400,
    fontSize: 11,
    letterSpacing: 0.06,
    color: color,
  );
  body ??= TextStyle(
    fontFamily: _kDefaultFontFamily,
    fontWeight: FontWeight.w400,
    fontSize: 13,
    letterSpacing: 0.06,
    color: color,
  );
  callout ??= TextStyle(
    fontFamily: _kDefaultFontFamily,
    fontWeight: FontWeight.w400,
    fontSize: 12,
    color: color,
  );
  footnote ??= TextStyle(
    fontFamily: _kDefaultFontFamily,
    fontWeight: FontWeight.w400,
    fontSize: 10,
    letterSpacing: 0.12,
    color: color,
  );
  caption1 ??= TextStyle(
    fontFamily: _kDefaultFontFamily,
    fontWeight: FontWeight.w400,
    fontSize: 10,
    letterSpacing: 0.12,
    color: color,
  );
  caption2 ??= TextStyle(
    fontFamily: _kDefaultFontFamily,
    fontWeight: FontWeight.w400,
    fontSize: 10,
    letterSpacing: 0.12,
    color: color,
  );
  return MacosTypography.raw(
    largeTitle: largeTitle,
    title1: title1,
    title2: title2,
    title3: title3,
    headline: headline,
    subheadline: subheadline,
    body: body,
    callout: callout,
    footnote: footnote,
    caption1: caption1,
    caption2: caption2,
  );
}