MyImage constructor

const MyImage(
  1. String src, {
  2. Key? key,
  3. BoxFit? fit,
  4. AlignmentGeometry alignment = Alignment.center,
  5. double? width,
  6. double? height,
  7. Color? color,
  8. Color? backgroundColor,
  9. BlendMode? colorBlendMode,
  10. ImageRepeat repeat = ImageRepeat.noRepeat,
  11. bool matchTextDirection = false,
  12. bool enableFullView = false,
  13. bool zoomInFullView = false,
  14. VoidCallback? onTap,
  15. BoxShape shape = BoxShape.rectangle,
  16. BorderRadiusGeometry? borderRadius,
  17. Clip clipBehavior = Clip.antiAlias,
  18. Widget placeholder(
    1. BuildContext context,
    2. StackTrace? error
    )?,
  19. double? borderWidth,
  20. Color? borderColor,
})

Creates a customized Image widget from a network URL.

Implementation

const MyImage(
  this.src, {
  super.key,
  this.fit,
  this.alignment = Alignment.center,
  this.width,
  this.height,
  this.color,
  this.backgroundColor,
  this.colorBlendMode,
  this.repeat = ImageRepeat.noRepeat,
  this.matchTextDirection = false,
  this.enableFullView = false,
  this.zoomInFullView = false,
  this.onTap,
  this.shape = BoxShape.rectangle,
  this.borderRadius,
  this.clipBehavior = Clip.antiAlias,
  this.placeholder,
  this.borderWidth,
  this.borderColor,
})  : source = MyImageSource.network,
      assert(
        shape != BoxShape.circle || borderRadius == null,
        'A borderRadius cannot be given when the shape is BoxShape.circle.',
      );