webImage function
Widget
webImage({
- required BuildContext context,
- required String imageUrl,
- double? width,
- double? height,
This widget creates a view for the browser with HTML. A hole is cut in the flutter canvas, so to speak,
where the is rendered.
Implementation
Widget webImage({
required BuildContext context,
required String imageUrl,
double? width,
double? height,
}) {
// ignore: undefined_prefixed_name
ui.platformViewRegistry.registerViewFactory(
imageUrl,
(int viewId) => ImageElement(
src: imageUrl,
width: width?.toInt(),
height: height?.toInt(),
));
return SizedBox(
width: width,
height: height,
child: HtmlElementView(viewType: imageUrl),
);
}