asImage method
Image asImage(
- {double? width,
- double? height,
- ColorDescriptor? color,
- Key? key}
)
Implementation
Image asImage({
double? width,
double? height,
ColorDescriptor? color,
Key? key,
}) {
if (data != null) {
String base64String = data!.split('base64,').last;
return Image.memory(
base64Decode(base64String),
key: key,
width: width,
height: height,
color: color?.color,
);
}
return Image.asset(
location,
key: key,
width: width,
height: height,
color: color?.color,
package: packageName,
);
}