DecorationImageToo constructor

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

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 DecorationImageToo({
  required this.image,
  this.onError,
  this.fit,
  this.scale = 1.0,
  this.alignment = Alignment.center,
  this.repeatMode = Repeat.noRepeat,
  this.mirrorOffset = Offset.zero,
  this.colorFilter,
  this.centerSlice,
  this.matchTextDirection = false,
});