fromJson method

  1. @override
Size fromJson(
  1. Object? json
)

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;
}