DecorationImg constructor
const
DecorationImg({
- required ImageProvider<
Object> image, - double scale = 1.0,
- BoxFit? fit,
- AlignmentGeometry alignment = Alignment.center,
- Repeat repeatMode = Repeat.noRepeat,
- Offset mirrorOffset = Offset.zero,
- ColorFilter? colorFilter,
- Rect? centerSlice,
- bool matchTextDirection = false,
- ImageErrorListener? onError,
Creates an image to show in a BoxDecoration which supports the Repeat rendering modes including Repeat.mirror.
The image
, alignment
, repeatMode
, and matchTextDirection
arguments
must not be null
.
Like all package:img
classes, alignment
is ignored and forced
Alignment.center if repeat is set to Repeat.mirror,
Repeat.mirrorX, or 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 shifting a
Repeat.mirror
tiled image that is meant to fill an entire space.
See paintImageToo for a description of the meaning of these arguments.
Implementation
const DecorationImg({
required ImageProvider image,
double scale = 1.0,
BoxFit? fit,
AlignmentGeometry alignment = Alignment.center,
Repeat repeatMode = Repeat.noRepeat,
Offset mirrorOffset = Offset.zero,
ColorFilter? colorFilter,
Rect? centerSlice,
bool matchTextDirection = false,
ImageErrorListener? onError,
}) : super(
image: image,
scale: scale,
fit: fit,
alignment: alignment,
repeatMode: repeatMode,
mirrorOffset: mirrorOffset,
colorFilter: colorFilter,
centerSlice: centerSlice,
matchTextDirection: matchTextDirection,
onError: onError,
);