ImageToo constructor
- Key? key,
- required ImageProvider<
Object> image, - double? width,
- double? height,
- BoxFit? fit,
- AlignmentGeometry alignment = Alignment.center,
- Repeat repeat = Repeat.noRepeat,
- Offset mirrorOffset = Offset.zero,
- Color? color,
- BlendMode? colorBlendMode,
- Rect? centerSlice,
- bool matchTextDirection = false,
- bool gaplessPlayback = false,
- bool isAntiAlias = false,
- FilterQuality filterQuality = FilterQuality.low,
- String? semanticLabel,
- bool excludeFromSemantics = false,
- ImageFrameBuilder? frameBuilder,
- ImageLoadingBuilder? loadingBuilder,
- ImageErrorWidgetBuilder? errorBuilder,
A StatefulWidget that renders its required image field, an ImageProvider,
according to the other optional properties.
This image Widget
supports an expanded concept of ImageRepeat
defined
as Repeat.
Thus this ImageToo
can render an image smaller than its
bounds by mirror-tiling with
Repeat.mirror as well as the expected values such as Repeat.noRepeat,
Repeat.repeat, etc.
For convenience, consider StringToTexture. It is used by calling one of
the three methods
(one each for Repeat.mirror, Repeat.mirrorX, Repeat.mirrorY)
on a String
such as:
final Widget imageToo = 'https://url.to/image.png'.toSeamlessTexture();
For a const ImageToo
, construct a new ImageToo
with an ImageProvider
as the image
property.
Like all package:img
classes, alignment
is ignored and forced Alignment.center
if repeat is set to Repeat.mirror, Repeat.mirrorX, Repeat.mirrorY.
- To align/position the seamlessly-tiling image in this situation,
employ an Offset in the mirrorOffset field. - This is a workaround for now and only aids in "aligning" a
Repeat.mirror
tiled image if it is meant to fill an entire space, shifting its edges.
Implementation
const ImageToo({
Key? key,
required this.image,
this.width,
this.height,
this.fit,
this.alignment = Alignment.center,
this.repeat = Repeat.noRepeat,
this.mirrorOffset = Offset.zero,
this.color,
this.colorBlendMode,
this.centerSlice,
this.matchTextDirection = false,
this.gaplessPlayback = false,
this.isAntiAlias = false,
this.filterQuality = FilterQuality.low,
this.semanticLabel,
this.excludeFromSemantics = false,
this.frameBuilder,
this.loadingBuilder,
this.errorBuilder,
}) : super(key: key);