renderImage method

dynamic renderImage()

Implementation

renderImage() {
  final extension = flutter_path.extension(image);
  if (extension == '.svg') {
    if (image.startsWith('http')) {
      return SvgPicture.network(
        image,
        width: width,
        height: height,
        fit: fit,
        alignment: alignment,
      );
    }
    return SvgPicture.asset(
      image,
      width: width,
      height: height,
      fit: fit,
      alignment: alignment,
    );
  } else {
    if (image.startsWith('http')) {
      return Image.network(
        image,
        width: width,
        height: height,
        fit: fit,
        alignment: alignment,
      );
    }
    return Image.asset(
      image,
      width: width,
      height: height,
      fit: fit,
      alignment: alignment,
    );
  }
}