Hey, have you ever wanted to host your flutter web build without much work and confusion? I’ve got a small trick for you in here. You can even use your existing repository to host a new flutter web build. We’ll get into the working right away.

Note: In this example, we will host only the release build of the flutter web and update it, rather than the whole flutter project itself on GitHub (which is simple). This method is quite helpful, if you want to use an existing repository to have the build files.

You can use peanut to simplify this process, if you want the build and project files in a single repository. But, it cannot be used when you have an existing repository, that you have to make changes to.

We will be making a **trick or treat **web app using flutter and host it’s release build on GitHub Pages.

Image for post

Step 1: Creating a flutter web project.

To create a flutter web project, you have to be in one of the following flutter channels : beta, dev or master. Change your channel and upgrade it, if you were in stable and then proceed to the next step.

Enable support for flutter-web in terminal/command-prompt:

$ flutter config --enable-web

Now, create your flutter project like you usually do and it will have web support. If you want to add web support to an existing project you can use the following command inside the directory:

$ flutter create .

Image for post

After creating your flutter project, you can check if you have the web directory. It shows that your project supports flutter-web.

The sources for the examples are at the end of this page.

Now, you can also publish it on GitHub.

#github-pages #flutter #dart #flutter-web #flutter-widget

Deploy and maintain your flutter web build in GitHub Pages exclusively.
14.40 GEEK