toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => {
  'type': type,
  'name': name,
  'width': width.toJson(),
  'height': height.toJson(),
  if (origin.isNotEmpty) 'origin': origin,
  if (source != null) 'source': source,
  if (position != null) 'position': position!.toJson(),
  if (rotation != 0) 'rotation': rotation,
  if (instance != null) 'instance': instance!.toJson(),
  ..._props(),
};