DecorationImg constructor

const DecorationImg({
  1. required ImageProvider<Object> image,
  2. double scale = 1.0,
  3. BoxFit? fit,
  4. AlignmentGeometry alignment = Alignment.center,
  5. Repeat repeatMode = Repeat.noRepeat,
  6. Offset mirrorOffset = Offset.zero,
  7. ColorFilter? colorFilter,
  8. Rect? centerSlice,
  9. bool matchTextDirection = false,
  10. 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,
      );