Ink.image constructor

Ink.image({Key key, EdgeInsetsGeometry padding, @required ImageProvider image, ColorFilter colorFilter, BoxFit fit, AlignmentGeometry alignment: Alignment.center, Rect centerSlice, ImageRepeat repeat: ImageRepeat.noRepeat, bool matchTextDirection: false, double width, double height, Widget child })

Creates a widget that shows an image (obtained from an ImageProvider) on a Material.

This argument is a shorthand for passing a BoxDecoration that has only its BoxDecoration.image property set to the new Ink constructor. The properties of the DecorationImage of that BoxDecoration are set according to the arguments passed to this method.

The image argument must not be null. The alignment, repeat, and matchTextDirection arguments must not be null either, but they have default values.

See paintImage for a description of the meaning of these arguments.

Implementation

Ink.image({
  Key key,
  this.padding,
  @required ImageProvider image,
  ColorFilter colorFilter,
  BoxFit fit,
  AlignmentGeometry alignment = Alignment.center,
  Rect centerSlice,
  ImageRepeat repeat = ImageRepeat.noRepeat,
  bool matchTextDirection = false,
  this.width,
  this.height,
  this.child,
}) : assert(padding == null || padding.isNonNegative),
     assert(image != null),
     assert(alignment != null),
     assert(repeat != null),
     assert(matchTextDirection != null),
     decoration = BoxDecoration(
       image: DecorationImage(
         image: image,
         colorFilter: colorFilter,
         fit: fit,
         alignment: alignment,
         centerSlice: centerSlice,
         repeat: repeat,
         matchTextDirection: matchTextDirection,
       ),
     ),
     super(key: key);