ImageViewer constructor

ImageViewer({
  1. required double? width,
  2. required double? height,
  3. String? urlImage,
  4. String? assetImage,
  5. Widget? onErrorWidget,
  6. Widget? onLoadingWidget,
  7. Color? backgroundColor,
  8. Border? border,
  9. BoxShadow? shadow,
  10. BorderRadius? borderRadius,
  11. EdgeInsetsGeometry? margin,
  12. BoxFit? fit,
  13. BoxShape? shape,
  14. Object? tag,
  15. Duration? duration,
  16. int? maxSize,
  17. Map<String, String>? headers,
  18. Key? key,
  19. IconData? errorIcon,
})

Implementation

ImageViewer({
  required super.width,
  required super.height,
  super.urlImage,
  super.assetImage,
  super.onErrorWidget,
  super.onLoadingWidget,
  super.backgroundColor,
  super.border,
  super.shadow,
  super.borderRadius,
  final EdgeInsetsGeometry ? margin,
  final BoxFit             ? fit,
  final BoxShape           ? shape,
  super.tag,
  super.duration,
  super.maxSize,
  super.headers,
  super.key,
  super.errorIcon,
}) :
assert(urlImage == null || assetImage == null, "Only one image must be provided"),
assert(shape != BoxShape.circle || borderRadius == null, "If shape == BoxShape.circle, borderRadius must be null"),
super(
  margin          : margin ?? EdgeInsets.zero,
  fit             : fit    ?? BoxFit.cover,
  shape           : shape  ?? BoxShape.rectangle,
  readOnly        : true,
  viewerBlur      : false,
  viewerBlurSigma : 0,
);