uiImage method

Image uiImage({
  1. required CImageType type,
  2. required dynamic src,
  3. Alignment alignment = Alignment.center,
  4. BoxFit? fit,
  5. double? height,
  6. ImageRepeat repeat = ImageRepeat.noRepeat,
  7. double? width,
})

Will create an image widget based on the specified CImageType enumerated value and display it when available based on the characteristics specified with the widget. No theme controls this widget type so the characteristics are unique to each widget created.

Implementation

Image uiImage({
  required CImageType type,
  required dynamic src,
  Alignment alignment = Alignment.center,
  BoxFit? fit,
  double? height,
  ImageRepeat repeat = ImageRepeat.noRepeat,
  double? width,
}) {
  if (type == CImageType.asset) {
    return Image.asset(
      src,
      alignment: alignment,
      fit: fit,
      height: height,
      repeat: repeat,
      width: width,
    );
  } else if (type == CImageType.file) {
    return Image.file(
      src,
      alignment: alignment,
      fit: fit,
      height: height,
      repeat: repeat,
      width: width,
    );
  } else if (type == CImageType.memory) {
    return Image.memory(
      src,
      alignment: alignment,
      fit: fit,
      height: height,
      repeat: repeat,
      width: width,
    );
  }
  return Image.network(
    src,
    alignment: alignment,
    fit: fit,
    height: height,
    repeat: repeat,
    width: width,
  );
}