toMap method
Convert page to map.
Implementation
Map<String, dynamic> toMap() {
Map<String, dynamic> map = <String, dynamic>{
'type': type,
'pageSize': [pageSize.size.width, pageSize.size.height],
};
if (sourcePattern != null) {
map['pattern'] = sourcePattern?.toMap();
}
if (imagePage != null) {
map['imagePage'] = imagePage?.toMap();
}
if (pdfPage != null) {
map['pdfPage'] = pdfPage?.toMap();
}
if (margins != null) {
map['margins'] = [
margins!.left,
margins!.top,
margins!.right,
margins!.bottom
];
}
if (rotation != null) {
map['rotation'] = rotation;
}
if (backgroundColor != null) {
map['backgroundColor'] = backgroundColor?.value;
}
return map;
}