fromJson method
Implementation
@override
Size fromJson(Object? json) {
if (json is Map<String, dynamic>) {
final width = json['width'];
final height = json['height'];
return Size(
width is num ? width.toDouble() : 0.0,
height is num ? height.toDouble() : 0.0,
);
}
return Size.zero;
}