3

I've just created a flutter web application and now I am ready to deploy it. Looking at the docs it looks like I need to use Firebase Hosting? But I want to host the app on my own server. I tried copying the web directory from Build but when I go to the path I get a blank screen on web. How do I deploy it correctly? Or is it just simply not possible without Firebase?

1 Answer 1

13

First you need to compile the application.

In a terminal, command prompt or Powershell, go to the root directory of your project.

From there run a build:

flutter build web

This will create a new directory inside your project.

c:\your-project-folder\build\web

Copy everything that is in the web folder to wherever you want to publish / host your application.

Your application is bundled up into a main.dart.js file.

An index.html is also in that directory. You should be able to run your Flutter web app by visiting that index.html.

All the instructions for building a Flutter application for web platform is here.

flutter build web directory

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, bro I was missing a step. Big help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.