toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  final map = <String, dynamic>{
    'number': number,
    'type': type,
    'bbox': bbox.toList(),
  };
  if (type == 0 && lines != null) {
    map['lines'] = lines!.map((l) => l.toMap()).toList();
  }
  if (type == 1) {
    map['width'] = imageWidth;
    map['height'] = imageHeight;
    map['colorspace'] = imageColorspace;
    map['bpc'] = imageBpc;
    map['xref'] = imageXref;
    map['size'] = imageSize;
  }
  return map;
}