ImageStyle class

A configuration class that defines how an image should be displayed.

ImageStyle provides a way to specify how images should be sized, positioned, and blended within their containers.

See also:

  • doc/component/image.md for more detailed documentation
  • ImageView, which uses this class to style images
  • ImagePlaceholderView, which uses this class for placeholder styling

Constructors

ImageStyle.new({BoxFit fit = BoxFit.contain, double width = double.infinity, double height = double.infinity, Color? color, BlendMode? colorBlendMode, AlignmentGeometry? alignment})
Creates an ImageStyle configuration.
const

Properties

alignment AlignmentGeometry?
Alignment of the image within its bounds.
final
color Color?
Color to blend with the image.
final
colorBlendMode BlendMode?
Blend mode for applying the color.
final
fit BoxFit
How the image should be inscribed into the space.
final
hashCode int
The hash code for this object.
no setterinherited
height double
Height of the image.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width double
Width of the image.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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