BackgroundType.pattern constructor

const BackgroundType.pattern({
  1. @JsonKey(name: 'type') @Default(BackgroundTypeType.pattern) BackgroundTypeType type,
  2. @JsonKey(name: 'document') required Document document,
  3. @JsonKey(name: 'fill') required BackgroundFill fill,
  4. @JsonKey(name: 'intensity') @Default(0) int intensity,
  5. @JsonKey(name: "is_inverted") bool? isInverted,
  6. @JsonKey(name: "is_moving") bool? isMoving,
})

The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.

Implementation

const factory BackgroundType.pattern({
  /// Type of the background - always `pattern`
  @JsonKey(name: 'type')
  @Default(BackgroundTypeType.pattern)
  BackgroundTypeType type,

  /// Document with the wallpaper.
  @JsonKey(name: 'document') required final Document document,

  /// The background fill that is combined with the pattern.
  @JsonKey(name: 'fill') required final BackgroundFill fill,

  /// Intensity of the pattern when it is shown above the filled background;
  /// 0-100.
  @JsonKey(name: 'intensity') @Default(0) final int intensity,

  /// True, if the background fill must be applied only to the pattern itself.
  /// All other pixels are black in this case. For dark themes only.
  @JsonKey(name: "is_inverted") final bool? isInverted,

  /// True, if the background moves slightly when the device is tilted.
  @JsonKey(name: "is_moving") final bool? isMoving,
}) = BackgroundTypePattern;