MyImage constructor
const
MyImage(
- String src, {
- Key? key,
- BoxFit? fit,
- AlignmentGeometry alignment = Alignment.center,
- double? width,
- double? height,
- Color? color,
- Color? backgroundColor,
- BlendMode? colorBlendMode,
- ImageRepeat repeat = ImageRepeat.noRepeat,
- bool matchTextDirection = false,
- bool enableFullView = false,
- bool zoomInFullView = false,
- VoidCallback? onTap,
- BoxShape shape = BoxShape.rectangle,
- BorderRadiusGeometry? borderRadius,
- Clip clipBehavior = Clip.antiAlias,
- Widget placeholder(
- BuildContext context,
- StackTrace? error
- double? borderWidth,
- 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.',
);