imageByUrl function
Image
imageByUrl(
- String imageUrl, {
- double? width,
- double? height,
- AlignmentGeometry alignment = Alignment.center,
Implementation
Image imageByUrl(String imageUrl, {double? width, double? height, AlignmentGeometry alignment = Alignment.center}) {
if (isImageBase64(imageUrl)) {
return Image.memory(base64.decode(imageUrl), width: width, height: height, alignment: alignment);
}
if (imageUrl.startsWith('http')) {
return Image.network(imageUrl, width: width, height: height, alignment: alignment);
}
return Image.file(io.File(imageUrl), width: width, height: height, alignment: alignment);
}