base64ImageRender function
Implementation
ImageRender base64ImageRender() => (context, attributes, element) {
final decodedImage =
base64.decode(_src(attributes)!.split("base64,")[1].trim());
precacheImage(
MemoryImage(decodedImage),
context.buildContext,
onError: (exception, StackTrace? stackTrace) {
context.parser.onImageError?.call(exception, stackTrace);
},
);
return Image.memory(
decodedImage,
frameBuilder: (ctx, child, frame, _) {
if (frame == null) {
return Text(_alt(attributes) ?? "",
style: context.style.generateTextStyle());
}
return child;
},
);
};