BackgroundFill class sealed

This object describes the way a background is filled based on the selected colors. Currently, it can be one of

Available extensions
Annotations
  • @Freezed.new(unionKey: 'type', unionValueCase: FreezedUnionCase.snake)

Constructors

BackgroundFill.freeformGradient({@JsonKey.new(name: 'type') @Default.new(BackgroundFillType.freeformGradient) BackgroundFillType type, @JsonKey.new(name: 'colors') required List<int> colors})
Constructs a Freeform Gradient BackgroundFill
const
factory
BackgroundFill.fromJson(Map<String, Object?> json)
factory
BackgroundFill.gradient({@JsonKey.new(name: 'type') @Default.new(BackgroundFillType.gradient) BackgroundFillType type, @JsonKey.new(name: 'top_color') required int topColor, @JsonKey.new(name: 'bottom_color') required int bottomColor, @JsonKey.new(name: 'rotation_angle') required int rotationAngle})
Constructs a BackgroundFillGradient object.
const
factory
BackgroundFill.solid({@JsonKey.new(name: 'type') @Default.new(BackgroundFillType.solid) BackgroundFillType type, @JsonKey.new(name: 'color') required int color})
Constructs a BackgroundFillSolid instance
const
factory

Properties

copyWith → $BackgroundFillCopyWith<BackgroundFill>
Create a copy of BackgroundFill with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type BackgroundFillType
Type of the background fill - always solid
no setterinherited

Methods

map<TResult extends Object?>({required TResult solid(BackgroundFillSolid value), required TResult gradient(BackgroundFillGradient value), required TResult freeformGradient(BackgroundFillFreeformGradient value)}) → TResult

Available on BackgroundFill, provided by the BackgroundFillPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? solid(BackgroundFillSolid value)?, TResult? gradient(BackgroundFillGradient value)?, TResult? freeformGradient(BackgroundFillFreeformGradient value)?}) → TResult?

Available on BackgroundFill, provided by the BackgroundFillPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult solid(BackgroundFillSolid value)?, TResult gradient(BackgroundFillGradient value)?, TResult freeformGradient(BackgroundFillFreeformGradient value)?, required TResult orElse()}) → TResult

Available on BackgroundFill, provided by the BackgroundFillPatterns extension

A variant of map that fallback to returning orElse.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this BackgroundFill to a JSON map.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited