tryParse static method

GradientThemeConfig? tryParse(
  1. Object? source
)

Implementation

static GradientThemeConfig? 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 GradientThemeConfig(
    light: ThemeGradients.parse(light),
    dark: ThemeGradients.parse(dark),
  );
}