Rect.fromJson constructor

Rect.fromJson(
  1. Map<String, dynamic> json
)

Creates a new instance from a JSON map.

Implementation

factory Rect.fromJson(Map<String, dynamic> json) {
  return Rect(
    x: (json['x'] as num).toDouble(),
    y: (json['y'] as num).toDouble(),
    width: (json['width'] as num).toDouble(),
    height: (json['height'] as num).toDouble(),
  );
}