GradientConfig.fromJson constructor
Creates a GradientConfig from a JSON map.
Implementation
factory GradientConfig.fromJson(Map<String, dynamic> json) {
final colorsJson = json['colors'] as List<dynamic>? ?? [];
return GradientConfig(
enabled: json['enabled'] as bool? ?? false,
colors: colorsJson.map((c) => c as String).toList(),
angle: (json['angle'] as num?)?.toDouble() ?? 135.0,
);
}