Greetings iam working on a flutter app( mobile + web + desktop)
my backend is asp.net core
when iam trying to call my API (on mobile and desktop) it works perfectly but when I am calling from the web (chrome) iam get this error
Unsupported operation: Platform._version
my question is it something related to flutter or asp.net core
i really did some research but none helped can someone help me in that
2
Answers
The all idea is to enable CORS on the web api here is what you need to do in Startup.cs Go to ConfigureServices and add this code
now in the Configure method add this code
also in every controller you need to add [EnableCors] this worked for me
The issue is most likely related to using dart:io which is not compatible with web.
If you post the full stack trace we can get a better idea.
Try using https://pub.dev/packages/universal_io instead or even better https://pub.dev/packages/dio