imageFromBase64String method

Image imageFromBase64String(
  1. String base64String,
  2. double? width,
  3. double? height
)

Implementation

Image imageFromBase64String(
    String base64String, double? width, double? height) {
  var decodedBase64 = base64String.replaceAll("\n", Constants.emptyString);
  Uint8List image = const Base64Decoder().convert(decodedBase64);
  return Image.memory(
    image,
    key: ValueKey<String>(base64String),
    width: width ?? double.infinity,
    height: height ?? double.infinity,
    fit: BoxFit.cover,
    gaplessPlayback: true,
  );
}