ImageStyle class

The ImageStyle class defines visual and behavioral properties for images within the Flint UI framework.

It provides attributes such as opacity, filter, fit, title, and decoding to control how images are displayed and optimized during rendering.

This class is commonly used with widgets like FlintImage to provide fine-grained image customization and consistent visual rendering across multiple output formats (HTML, email, CLI, etc.).

Example:

ImageStyle(
  opacity: 0.9,
  filter: 'grayscale(50%)',
  fit: ObjectFit.cover,
  title: 'Company Logo',
  decoding: ImageDecoding.auto,
);

Constructors

ImageStyle({double? opacity, String? filter, ObjectFit fit = ObjectFit.contain, String? title, ImageDecoding? decoding})
Creates a new ImageStyle instance.
const

Properties

decoding ImageDecoding?
Specifies how the image should be decoded by the browser or renderer.
final
filter String?
Applies a CSS-compatible visual filter to the image (e.g., "blur(4px)", "grayscale(50%)", or "brightness(120%)").
final
fit ObjectFit
Defines how the image should fit within its container.
final
hashCode int
The hash code for this object.
no setterinherited
opacity double?
Adjusts the image's transparency level, between 0.0 (fully transparent) and 1.0 (fully opaque).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
Provides an optional title or tooltip for the image.
final

Methods

copyWith({double? opacity, String? filter, ObjectFit? fit, String? title, ImageDecoding? decoding}) ImageStyle
Returns a new ImageStyle object with modified properties.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this style configuration into a serializable JSON object.
toString() String
A string representation of this object.
inherited

Operators

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