AreaPosition constructor

const AreaPosition({
  1. @JsonKey.new(name: 'x_percentage') required double xPercentage,
  2. @JsonKey.new(name: 'y_percentage') required double yPercentage,
  3. @JsonKey.new(name: 'width_percentage') required double widthPercentage,
  4. @JsonKey.new(name: 'height_percentage') required double heightPercentage,
  5. @JsonKey.new(name: 'rotation_angle') required double rotationAngle,
  6. @JsonKey.new(name: 'corner_radius_percentage') required double cornerRadiusPercentage,
})

Creates a new AreaPosition object.

Implementation

const factory AreaPosition({
  /// The abscissa of the rectangle's center, as a percentage of the media
  /// or card width
  @JsonKey(name: 'x_percentage') required double xPercentage,

  /// The ordinate of the rectangle's center, as a percentage of the media
  /// or card height
  @JsonKey(name: 'y_percentage') required double yPercentage,

  /// The width of the rectangle, as a percentage of the media or card width
  @JsonKey(name: 'width_percentage') required double widthPercentage,

  /// The height of the rectangle, as a percentage of the media or card
  /// height
  @JsonKey(name: 'height_percentage') required double heightPercentage,

  /// The clockwise rotation angle of the rectangle, in degrees; 0-360
  @JsonKey(name: 'rotation_angle') required double rotationAngle,

  /// The radius of the rectangle corner rounding, as a percentage of the
  /// media or card width
  @JsonKey(name: 'corner_radius_percentage')
  required double cornerRadiusPercentage,
}) = _AreaPosition;