createMaterialColor static method

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

Implementation

static MaterialColor? createMaterialColor({int? intColor, Color? color}) {
  final Color? newColor = intColor?.let(Color.new) ?? color;

  if (newColor == null) return null;

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