ImageStyle class

How an image is drawn.

Every field is optional. An unset field falls back to the theme, then to the value the package used before this style existed — so setting one field changes one thing and nothing else moves.

A style on the widget wins over the theme per field, not per object.

Annotations

Constructors

ImageStyle({Radius? borderRadius, EdgeInsetsGeometry? padding, BoxFit? fit, double? maxWidth, double? maxHeight})
Creates a ImageStyle. Null fields defer to the theme, then to the default.
const

Properties

borderRadius Radius?
Corner rounding. Defaults to square.
final
fit BoxFit?
How the image fills its box. Defaults to the widget default.
final
hashCode int
The hash code for this object.
no setteroverride
maxHeight double?
Upper bound on height. Defaults to unbounded.
final
maxWidth double?
Upper bound on width. Defaults to unbounded.
final
padding EdgeInsetsGeometry?
Space around the image. Defaults to none.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({Radius? borderRadius, EdgeInsetsGeometry? padding, BoxFit? fit, double? maxWidth, double? maxHeight}) ImageStyle
A copy with the given fields replaced.
merge(ImageStyle? other) ImageStyle
This style, with any unset field taken from other, field by field.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(ColorScheme scheme) ImageStyle
This style with every remaining default filled in.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

lerp(ImageStyle? a, ImageStyle? b, double t) ImageStyle?
Linearly interpolates between two styles.