I've got a Pi 4 with Raspbian 10 and apache2 2.4.38, with default option.
I can put a "hello world" index.html in /var/www/html/
and access it in Chromium (http://localhost), or from another laptop in my home network (http://piIP).
I've made a Flutter web application with (in a laptop):
- flutter create -t skeleton flutter_skeleton
- cd flutter_skeleton
- flutter build web
- Copy the content of flutter_skeleton/build/web to the Pi /var/www/html folder
- In the Pi, sudo service apache2 restart
I can see the flutter app from another machine in the same network (http://piIP). However, in the Pi itself, with Chromium (http://localhost) I can only see the favicon and the title, but the page is blank.
I have accessed the developer tools in Chromium (Ctrl+Shift+I) and the console shows:
Failed to load resource:
net::ERR_NAME_NOT_RESOLVED
is this an apache2 configuration issue or an issue with Flutter? Any pointers to what may be causing this or how to solve it?
1 Answer 1
Default renderer for web app is CanvasKit. In https://github.com/flutter/flutter/issues/78235# they explain that "We don't yet automatically bundle CanvasKit for offline development." there is a workaround but I tried using the html renderer and it worked.
flutter build web --web-renderer html