createMaterialColor static method

MaterialColor? createMaterialColor({
  1. int? intColor,
  2. Color? color,
})

Implementation

static MaterialColor? createMaterialColor({
  int? intColor,
  Color? color,
}) {
  if (intColor != null) {
    color = Color(intColor);
  }

  if (color == null) {
    return null;
  }

  return MaterialColor(
    colorToInt(color),
    <int, Color>{
      50: color,
      100: color,
      200: color,
      300: color,
      400: color,
      500: color,
      600: color,
      700: color,
      800: color,
      900: color,
    },
  );
}