toJson method
Implementation
Map<String, dynamic> toJson() {
bool disableAlignAndSize = type != GetnetPrintType.text;
return {
'type': type.name.toString(),
'content': type != GetnetPrintType.image ? _formatContent() : null,
'align': disableAlignAndSize ? null : align?.name.toString(),
'size': disableAlignAndSize ? null : size?.name.toString(),
'imagePath': type == GetnetPrintType.image ? imagePath : null,
};
}