SingImage constructor
SingImage(
- String imagePath, {
- Key? key,
- double? width,
- double? height,
- double marginBottom = 0,
- double marginRight = 0,
- double marginTop = 0,
- double marginLeft = 0,
- double margin = 0,
- double cornerRadius = 0,
- bool isCircle = false,
- Color borderColor = Colors.transparent,
- double borderWidth = 0,
- Color backgroundColor = Colors.transparent,
- Color? color,
- VoidCallback? onClick,
Implementation
SingImage(this.imagePath, { super.key,
this.width,
this.height,
this.marginBottom = 0,
this.marginRight = 0,
this.marginTop = 0,
this.marginLeft = 0,
this.margin = 0,
this.cornerRadius = 0,
this.isCircle = false,
this.borderColor = Colors.transparent,
this.borderWidth = 0,
this.backgroundColor = Colors.transparent,
this.color,
this.onClick,
}) {
if (margin > 0) {
marginLeft = margin;
marginTop = margin;
marginRight = margin;
marginBottom = margin;
}
if (isCircle) {
cornerRadius = width ?? 0 / 2;
}
if(height == null && width != null){
height = width;
}
onClick ??= () {};
}