FontModel.fromJson constructor
Implementation
factory FontModel.fromJson(Map<String, dynamic> json) {
Map<int, String>? fontWeights;
if (json["fontWeights"] != null) {
fontWeights = json["fontWeights"]
.map((key, value) => MapEntry(int.parse(key), value))
.cast<int, String>();
}
return FontModel(
fontFamily: json["fontFamily"],
fontUrl: json["fontUrl"],
fontWeights: fontWeights,
);
}