webImage function

Widget webImage({
  1. required BuildContext context,
  2. required String imageUrl,
  3. double? width,
  4. double? height,
})

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));
}