Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get white screen when building flutter web

I want to build a flutter web app, so I enter 'webdev build' command and after the operation finishes, I open the 'index.html' file located in build directory and it's just a white screen. I tried it on a fresh project and the problem persists. There's no problem during developing.

enter image description here

Here's my flutter doctor output:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17134.766], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.3)
[√] VS Code (version 1.35.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.
like image 966
Xoltawn Avatar asked Jun 15 '19 18:06

Xoltawn


2 Answers

For me seemed to have been a problem with antivirus and running flutter run -d chrome --release solved my problem.

like image 195
William Orgeness II Avatar answered Sep 19 '22 08:09

William Orgeness II


You have to upload your files to the server and put them inside the root folder.

If you want to put them in other folder, you have to edit the "index.html" file to tell hem the folder.

For example: If you upload your files to "test" folder, you have to edit this line of "index.html":

<base href="/">

To

<base href="/test/">
like image 36
Muaiyed Al-qateefi Avatar answered Sep 17 '22 08:09

Muaiyed Al-qateefi