ImageDisplayController constructor
ImageDisplayController({
- String imagePath = '',
- double? width,
- double? height,
- BoxFit? fit,
- BorderRadius? borderRadius,
- bool? showCloseButton,
- VoidCallback? onRemove,
Implementation
ImageDisplayController({
String imagePath = '',
double? width,
double? height,
BoxFit? fit,
BorderRadius? borderRadius,
bool? showCloseButton,
this.onRemove,
}) {
this.imagePath.value = imagePath;
if (width != null) this.width.value = width;
if (height != null) this.height.value = height;
if (fit != null) this.fit.value = fit;
if (borderRadius != null) this.borderRadius.value = borderRadius;
if (showCloseButton != null) this.showCloseButton.value = showCloseButton;
// init icon widget ตอนสร้าง controller เลย
iconWidget = const IconifyIcon(
icon: 'mdi:close',
size: 20,
color: Colors.grey,
);
iconWplay = const IconifyIcon(
icon: 'mdi:close',
size: 20,
color: Colors.grey,
);
}