Typography.material2021 constructor Null safety

Typography.material2021(
  1. {TargetPlatform? platform = TargetPlatform.android,
  2. TextTheme? black,
  3. TextTheme? white,
  4. TextTheme? englishLike,
  5. TextTheme? dense,
  6. TextTheme? tall}
)

Creates a typography instance using Material Design 3 2021 defaults.

If platform is TargetPlatform.iOS or TargetPlatform.macOS, the default values for black and white are blackCupertino and whiteCupertino respectively. Otherwise they are blackMountainView and whiteMountainView. If platform is null then both black and white must be specified.

The default values for englishLike, dense, and tall are englishLike2021, dense2021, and tall2021.

Implementation

factory Typography.material2021({
  TargetPlatform? platform = TargetPlatform.android,
  TextTheme? black,
  TextTheme? white,
  TextTheme? englishLike,
  TextTheme? dense,
  TextTheme? tall,
}) {
  assert(platform != null || (black != null && white != null));
  return Typography._withPlatform(
    platform,
    black, white,
    englishLike ?? englishLike2021,
    dense ?? dense2021,
    tall ?? tall2021,
  );
}