Project

General

Profile

Actions

Task #20

closed

Task #19: Ensure Compatibility with Flutter Web

Initialize Flutter Web Environment

Task #20: Initialize Flutter Web Environment

Added by Fadi Hussein about 2 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
High
Assignee:
Milad Khnefes
Target version:
Sunnex - V1.1
Start date:
01/26/2026
Due date:
% Done:

100%

Estimated time:
2:00 h
Spent time:

Updated by Milad Khnefes about 2 months ago Actions #1

  • 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 Actions #2

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 Actions #3

App is up and running on Web

Updated by Fadi Hussein about 1 month ago Actions #4

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom