DEV Community

loading...

Trying Flutter Web

muhajirdev profile image Muhammad Muhajir ・1 min read

Google just released flutter for the web. This is awesome. With flutter, you will be able to use a single codebase to develop iOS App, Android App, Desktop App, Web and Embedded 🌟

flutter multi platform

We'll give it a shot

Getting Started

Install Flutter / Upgrade Flutter

Follow the installation path here on Flutter Official Docs

Or just upgrade it if have ever installed it

flutter upgrade
Enter fullscreen mode Exit fullscreen mode

Reference:

Create new project

You can either clone flutter/flutter_web. like so

# Clone
git clone https://github.com/flutter/flutter_web

# cd into example dir
cd flutter_web/examples/hello_world

# Activate web build tool
flutter packages pub global activate webdev
Enter fullscreen mode Exit fullscreen mode

Or just use Visual Studio Code. Install Dart Code & Flutter Plugins.

And then cmd + shift + p (on mac) or ctrl + shift + p (on windows/linux).
And type >Flutter: New Web Project

vscode-opening-flutter
After it's done. Go to main.dart and press F5(Debug shortcut) on your laptop. Or Press ▶️ on Macbook Pro Touchbar

That's it. Look at this beauty 💙

flutter-web-demo

I'll post more updates about flutter web. I'll let you guys know via my twitter @muhajirdev

Originally published on https://muhajir.dev/writing/trying-flutter-web/

Discussion (4)

pic
Editor guide
Collapse
dfelten profile image
Daniel Felten • Edited

Thanks for the article. But currently a shared code basis is not possible between flutter web and a mobile flutter app.

Using the same code is at least in the tech preview not supported:

You have a dependency on `flutter` which is not supported for flutter_web tech preview.
You have a dependency on `flutter_test` which is not supported for flutter_web tech preview.
Collapse
seiyial profile image
SayHao

Yup we're all waiting for them to merge flutter_web and flutter but the hype is real!

Collapse
exequielc profile image
exequielc

I've already have a project for IOS and Android how about that. How build this projects for webdev ? can you helpme? thanks

Collapse
sebtardif profile image
Sebastien Tardif

I did the same with the super simple flutter_view example, which is one button and the button shows but doesn't execute. Flutter web is not not working.