toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return <String, dynamic>{
    'pages': pages.join(','),
    'type': type.value,
    if (color != null) 'color': color!.withValues(alpha: 1).toHex(),
    if (imagePath != null) 'image_path': imagePath,
    'opacity': opacity,
    'scale': scale,
    'rotation': rotation,
    'horizontal_alignment': horizontalAlignment.value,
    'vertical_alignment': verticalAlignment.value,
    'horizontal_offset': horizontalOffset,
    'vertical_offset': verticalOffset,
    'allow_view': allowView,
    'allow_print': allowPrint,
  };
}