toJson method
Converts the options to a JSON map for platform communication
Implementation
Map<String, dynamic> toJson() {
return {
'size': size,
'errorCorrectionLevel': errorCorrectionLevel.name,
'foregroundColor': foregroundColor.toARGB32(),
'backgroundColor': backgroundColor.toARGB32(),
'margin': margin,
'logoData': logoData,
'logoSizeRatio': logoSizeRatio,
'roundedCorners': roundedCorners,
'cornerRadius': cornerRadius,
'gradientColors': gradientColors
?.map((color) => color.toARGB32())
.toList(),
'gradientDirection': gradientDirection,
'addBorder': addBorder,
'borderWidth': borderWidth,
'borderColor': borderColor.toARGB32(),
};
}