tryParse static method

ColorThemeConfig? tryParse(
  1. Object? source
)

Implementation

static ColorThemeConfig? tryParse(Object? source) {
  if (source is String) source = jsonDecode(source);
  if (source is! Map) return null;
  final light = source['light'];
  final dark = source['dark'];
  return ColorThemeConfig(
    light: ThemeColors.parse(light),
    dark: ThemeColors.parse(dark),
  );
}