ImageViewer.square constructor

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

Implementation

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