fromJson method
Converts a JSON map to a Size object.
The JSON map must contain 'width' and 'height' keys with numeric values. Both integer and double values are supported and will be converted to doubles.
Example:
final converter = SizeConverter();
final size = converter.fromJson({'width': 100, 'height': 50});
// size.width == 100.0, size.height == 50.0
Implementation
@override
Size fromJson(Map<String, dynamic> json) {
return Size(
(json['width'] as num).toDouble(),
(json['height'] as num).toDouble(),
);
}