Task #20
closed
Task #19: Ensure Compatibility with Flutter Web
Initialize Flutter Web Environment
Updated by Milad Khnefes about 2 months ago
- Status changed from New to Resolved
- Target version set to V1.1
- % Done changed from 0 to 100
Had to check for the web platform using kIsWeb because Platform.isAndroid threw this DartError: Unsupported operation: Platform._operatingSystem
main.dart, line 43:
if (!kIsWeb && Platform.isAndroid)
Updated by Milad Khnefes about 2 months ago
ยท Edited
Managed to figure out the CORS problem and solve it from the backend side (sunnex/settings.py) using the following steps:
1- run pip install django-cors-headers
2- add CORS_ALLOW_ALL_ORIGINS = True and CORS_ALLOW_CREDENTIALS = True anywhere in the file (temporarily)
3- add 'corsheaders' to INSTALLED_APPS
4- add 'corsheaders.middleware.CorsMiddleware' to MIDDLEWARE
and the CORS policy would allow the web client to access the APIs.
Later on, we modify these when we're ready for deployment:
CORS_ALLOW_ALL_ORIGINS = False
CORS_ALLOWED_ORIGINS = [
"https://yourdomain.com",
"https://app.yourdomain.com",
]
Updated by Milad Khnefes about 2 months ago
App is up and running on Web
Updated by Fadi Hussein about 1 month ago
- Status changed from Resolved to Closed