I need to use canvaskit. I am finding some way can fix it too.
Now, I found 2 methods.
1.
Image.network('https://cors-anywhere.herokuapp.com/' + imageUrl)
import 'dart:html';
import 'dart:ui' as UI;
String imageUrl = ".png";
@override
void initState() {
ui.platformViewRegistry.registerViewFactory(
imageUrl,
(int viewId) => ImageElement()..src = imageUrl,
);
super.initState();
}
Widget showImg() {
return SizedBox(
width: 250,
height: 250,
child: HtmlElementView(viewType: imageUrl),
);
}
And add this below in analysis_option.yaml
analyzer:
errors:
undefined_prefixed_name: ignore
I think, There has some method about setting in flutter but I don't understand and have not seen any video about this.
If someone knows about this, please give the answer