fromJson method
Implementation
@override
MaterialColor? fromJson(Map<String, dynamic>? json) {
if (json == null) return null;
var swatches = <int, Color>{};
var swatchesIn = json['swatches'];
swatchesIn.forEach(
(key, json) => swatches[(key as num).toInt()] =
const NullableColorConverter().fromJson(json)!,
);
return MaterialColor(
const NullableColorConverter().fromJson(json['primary'])!.value,
swatches,
);
}