Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter web: blank screen when 'webdev build'

Tags:

flutter

dart

I made a webpage with flutter web. I tested it with the command

webdev serve

I can see the whole website,

But when I want to 'export / save' the website with this command:

webdev build

The webpage is blank, (when I open the html file in the build folder)

[INFO] Reading cached asset graph completed, took 245ms
[INFO] Checking for updates since last build completed, took 806ms
[INFO] Running build completed, took 217ms
[INFO] Caching finalized dependency graph completed, took 148ms
[INFO] Reading manifest at build/.build.manifest completed, took 1ms
[INFO] Deleting previous outputs in `build` completed, took 45ms
[INFO] Creating merged output dir `build` completed, took 226ms
[INFO] Writing asset manifest completed, took 4ms
[INFO] Succeeded after 671ms with 0 outputs (0 actions)

Thanks in advance!

UPDATE:

If I open the html file in the build folder (that gives a blank screen). These are my errors in the console of google chrome:

errorflutterweb

like image 975
Karel Debedts Avatar asked Nov 09 '19 17:11

Karel Debedts


People also ask

How do I get rid of the white screen on Flutter?

On the right hand side under properties, you will find the background attribute. Clicking on this and choosing custom will allow you to define the RGB value to override the white screen. After following these steps, your app will now no longer show the annoying white screen on either Android or iOS.

Is Flutter web good for production?

Well, it will. Many developers globally consider Flutter for enterprise web development because of the wide range of features it has to offer. Ever since its introduction, it has been fruitful for making app development easier than native apps.


1 Answers

I have a same issue but when I upload live server(host) it worked correctly. I am not sure but it can be about CORS, browser not allowed some source coming from outside of website so in local files has local source that means they are coming from outside the website as browser views. I think you should upload live server or local server.

like image 177
furkeen Avatar answered Sep 19 '22 01:09

furkeen