If you're calling to another URL from your flutter app, you need to manually allows the origin domains to avoid CORS policy for extra security. This is time consuming if you're setting up the policy on your production API server. So how do we solve it? We can solve it by two methods. 1- Allow your trusted domain from your development API server 2 - Run chrome with disable web security The second one is the easiest method so we'll start with the second method unless your app is already running on production server. Run chrome with disable web security Right click on desktop, add new shortcut. Add the target as "[PATH_TO_CHROME]\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp. Click OK. Make sure you run the created shortcut with admin rights. Allow your trusted domain from your development API server
Comments
Post a Comment