WatermarkOptions

Configurations of the watermark image.

@JsonSerializable(explicitToJson: true, includeIfNull: false)
class WatermarkOptions {
  const WatermarkOptions(
      {this.visibleInPreview,
      this.positionInLandscapeMode,
      this.positionInPortraitMode,
      this.watermarkRatio,
      this.mode});

  @JsonKey(name: 'visibleInPreview')
  final bool? visibleInPreview;

  @JsonKey(name: 'positionInLandscapeMode')
  final Rectangle? positionInLandscapeMode;

  @JsonKey(name: 'positionInPortraitMode')
  final Rectangle? positionInPortraitMode;

  @JsonKey(name: 'watermarkRatio')
  final WatermarkRatio? watermarkRatio;

  @JsonKey(name: 'mode')
  final WatermarkFitMode? mode;

  factory WatermarkOptions.fromJson(Map<String, dynamic> json) =>
      _$WatermarkOptionsFromJson(json);

  Map<String, dynamic> toJson() => _$WatermarkOptionsToJson(this);
}

Attributes

visibleInPreview
Whether the watermark is visible in the local preview view:
  • true: (Default) The watermark is visible in the local preview view.
  • false: The watermark is not visible in the local preview view.
positionInLandscapeMode
When the adaptation mode of the watermark is fitModeCoverPosition, it is used to set the area of the watermark image in landscape mode. See Rectangle.
positionInPortraitMode
When the adaptation mode of the watermark is fitModeCoverPosition, it is used to set the area of the watermark image in portrait mode. See Rectangle.
watermarkRatio
When the watermark adaptation mode is fitModeUseImageRatio, this parameter is used to set the watermark coordinates. See WatermarkRatio.
mode
The adaptation mode of the watermark. See WatermarkFitMode.