ImageDisplayController constructor

ImageDisplayController({
  1. String imagePath = '',
  2. double? width,
  3. double? height,
  4. BoxFit? fit,
  5. BorderRadius? borderRadius,
  6. bool? showCloseButton,
  7. 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,
  );
}