1

I'm new in flutter and I want to build web application by flutter web,flutter build apk is worked for me, but when I run Flutter build web I have this error.

I followed up every step according to this document and use // @dart=2.9 top of all of my class that has error null check.

do you have any idea about this problem?!

Abbas Asadi
  • 265
  • 1
  • 5
  • 14

2 Answers2

1

use these command--->

flutter channel beta
flutter config --enable-web
flutter create .

After creating you will find a web folder in your project

restart IDE or Editor if needed. Note: You must have google chrome

flutter devices

there you will be found your chrome then simply run or use the command ->

flutter run -d chrome
Gwhyyy
  • 7,554
  • 3
  • 8
  • 35
Rasel Khan
  • 2,976
  • 19
  • 25
0

You must use the channel master for flutter in order to build web version, more details here.

In resume, do:

flutter channel master
flutter upgrade
flutter config --enable-web

After that, just run flutter build web and then, go in root_of_your_app/build/web and run a web server inside like python with python -m http.server 8000 and go to http://localhost:8000 to see your app on any browsers.

Tryliom
  • 895
  • 1
  • 12
  • 37