Flutter For Web: Create and Deploy a Website From Scratch

Ayush Shekhar
May 8, 2019 · 6 min read
flutter upgrade

Add Dart SDK to Path

We need not install any Dart SDK separately, to be able to run flutter_web. All we have to do is add the existing Dart SDK, which ships with Flutter, to our path environment variable.

<path to our flutter directory>/bin/cache/dart-sdk/bin

Create and Configure New Flutter Web Project

First of all, we will create a new Flutter project, let’s name it hummingbird, (how original! *winks*). We can create the project manually from the terminal, but an easier way would be to do it using our IDE, so that we don’t have to go through the Flutter Web setup, manually.

Image for post
Image for post
Image for post
Image for post
flutter packages pub global activate webdevflutter packages upgrade
Image for post
Image for post
<path to flutter directory>/.pub-cache/bin
Image for post
Image for post

Running the Flutter Project in Browser

Well, if you followed all the above mentioned steps properly, then this should be as simple as executing the following command from inside the flutter web project directory.

webdev serve
Image for post
Image for post
Image for post
Image for post
webdev serve --auto restart
Image for post
Image for post

Build for Release and Deploy

Let’s get this done fast.

webdev build
Image for post
Image for post
Image for post
Image for post
npm i -g surge
cd build
surge
Image for post
Image for post

Flutter Community

Articles and Stories from the Flutter Community

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store