OudsListItemLeadingImage class
Leading image slot.
The image comes either from a local asset or from an asynchronous
source (NetworkImage, MemoryImage or any custom ImageProvider)
via the provider named constructor — the Flutter counterpart of passing
an async Painter on Android.
Example:
OudsListItemLeadingImage(
asset: 'assets/images/photo.jpg',
semanticsLabel: 'Product photo',
size: OudsListItemImageSize.large,
format: OudsListItemImageFormat.widescreen,
rounded: true,
)
// Asynchronous image from the network, with a placeholder shown while
// loading (and if loading fails)
OudsListItemLeadingImage.provider(
provider: NetworkImage('https://example.com/photo.jpg'),
semanticsLabel: 'Product photo',
placeholder: Image.asset('assets/placeholder.jpg'),
)
// Or from any other ImageProvider (memory, file, app-provided caching
// library), with a custom placeholder
OudsListItemLeadingImage.provider(
provider: MemoryImage(bytes),
placeholder: const ColoredBox(color: Color(0xFFEFEFEF)),
)
- Inheritance
-
- Object
- OudsListItemLeading
- OudsListItemLeadingImage
Constructors
- OudsListItemLeadingImage({required String asset, String? semanticsLabel, OudsListItemImageSize size = OudsListItemImageSize.medium, OudsListItemImageFormat format = OudsListItemImageFormat.square, bool rounded = false})
-
Creates a leading image configuration from a local asset.
const
-
OudsListItemLeadingImage.provider({required ImageProvider<
Object> ? provider, String? semanticsLabel, OudsListItemImageSize size = OudsListItemImageSize.medium, OudsListItemImageFormat format = OudsListItemImageFormat.square, bool rounded = false, Widget? placeholder}) -
Creates a leading image configuration from any ImageProvider
(NetworkImage, MemoryImage or a provider supplied by the app).
const
Properties
- asset → String?
-
Path to the image asset (raster or SVG).
final
- format → OudsListItemImageFormat
-
Aspect-ratio format. Defaults to
OudsListItemImageFormat.square.final - hashCode → int
-
The hash code for this object.
no setterinherited
- placeholder → Widget?
-
Widget displayed in place of the image while provider is loading and
if loading fails. Ignored for asset images.
final
-
provider
→ ImageProvider<
Object> ? -
Image provider for an image loaded asynchronously or from a non-asset
source (NetworkImage, MemoryImage or any custom provider).
final
- rounded → bool
-
Whether the image is displayed with rounded corners. Defaults to
false.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticsLabel → String?
-
Accessibility description of the image for screen readers.
final
- size → OudsListItemImageSize
-
Size of the image. Defaults to
OudsListItemImageSize.medium.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