Sample hosted at flutterweb-101.web.app.
- Creat a Flutter web project
flutter create --platforms=web .
-
Create a Firebase project
- Go to console.firebase.google.com
- Click on "Add project"
- Follow the instructions
- Once the project is created...
-
Enable hosting
- Click on "Hosting" on the left navigation (on the Firebase project page)
- Follow the instructions to install the Firebase CLI tools (if you don't already have them installed).
- When running
firebase init
, chooseHosting
andGitHub Action deploys
. - When going through the configuration, set
"public"
tobuild/web
. - Change the build command to
flutter build web
.
-
Update
.github/workflows
for Flutter- Update the two generated
firebase-hosting-
files to include Flutter setup:
steps: # This has to come before `flutter bulid web` - uses: subosito/flutter-action@v2.2.1 with: # Defining the channel is optional - I'm using beta channel: beta # Setting cache is also optional, although this does speed up builds! cache: true - uses: actions/checkout@v2
- Update the two generated