32.12 Flutter Web App

20210327 To build a JavaScript based web app:

$ flutter build web

This creates the standalone web app in build/web/. The assumed base for the app is root (/). For our example the base will actually be /app/ so we need to modify the base href:

$ perl -pi -e 's|<base href="/">|<base href="/app/">|' build/web/index.html

In the file itself:

  <base href="/app/">

The app is now ready to install to the server:

$ rsync -avzh build/web/ mlhub.ai:webapps/mlhub2/app/
$ ssh mlhub.ai chmod -R go+rX webapps/mlhub2/app

Visit the app in a browser as https://mlhub.ai/app/. The app takes something like 15 seconds to start, but once started:



Your donation will support ongoing availability and give you access to the PDF version of the book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0.