StyledImage
This is equivalent to the Image widget in Flutter.
StyledImage(
image: AssetImage('assets/image.jpg'),
style: ImageStyler()
.width(152)
.height(152)
.fit(BoxFit.cover),
);Constructor
| Prop | Type | Required / Default Value |
|---|---|---|
| image | ImageProvider<Object>? | Optional |
| frameBuilder | ImageFrameBuilder? | Optional |
| loadingBuilder | ImageLoadingBuilder? | Optional |
| errorBuilder | ImageErrorWidgetBuilder? | Optional |
| opacity | Animation<double>? | Optional |
| style | Style<ImageSpec> | Optional, defaults to ImageMix.create() |
| key | Key? | Optional |
Style API Reference
Mix provides an extension of Style<ImageSpec> called ImageStyler for easily styling StyledImage widgets.
| Method | Description |
|---|---|
animate | Sets animation configuration |
modifier | Adds widget modifiers |
image | Sets the image provider |
width | Sets image width |
height | Sets image height |
color | Sets color overlay for the image |
repeat | Sets how the image should be repeated |
fit | Sets how the image should be fitted within its container |
alignment | Sets image alignment within its bounds |
centerSlice | Sets center slice for nine-patch effects |
filterQuality | Sets filter quality for image scaling |
colorBlendMode | Sets blend mode for color overlay |
semanticLabel | Sets semantic label for accessibility |
excludeFromSemantics | Sets whether to exclude from semantics |
gaplessPlayback | Sets whether to maintain previous image while loading |
isAntiAlias | Sets whether to apply anti-aliasing |
matchTextDirection | Sets whether image should match text direction |