How to run flutter app on chrome. I have installed flutter kit and also run flutter channel beta flutter upgrade and also install extension on visual studio code.
Asked
Active
Viewed 2.3k times
18
-
do you have flutter version `1.12`? if so, follow https://flutter.dev/docs/get-started/web – pskink Jan 11 '20 at 09:43
4 Answers
50
Just like with flutter mobile
create flutter launch
configuration, but add the following line: "args": [ "-d", "chrome" ]
{
// launch.json
"version": "0.2.0",
"configurations": [
{
"name": "Flutter for web",
"type": "dart",
"request": "launch",
"program": "lib/main.dart",
"args": [
"-d",
"chrome"
]
}
]
}

Spatz
- 18,640
- 7
- 62
- 66
-
4It's weird, `flutter run -d chrome` works fine for me but with this launch config, chrome cannot reach the site :( – happy-san Nov 05 '20 at 17:00
11
You can write on terminal:
flutter run -d chrome

Saeed
- 3,294
- 5
- 35
- 52

INDIAN GAMER
- 119
- 3
-
2
-
we can use widget selector from vscode itself ,I think its not a problem – INDIAN GAMER Dec 07 '22 at 04:09
1
@Spatz is correct but I also had right below his answer configuration
{
"name": "new_app",
"request": "launch",
"type": "dart"
},
{
"name": "new_app (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
I had to delete these from launch.json for VSCode to launch the app in debug mode (able to step through) in Chrome.
Otherwise pushing F5 would start the debug mode but on my device.

mLstudent33
- 1,033
- 3
- 14
- 32
1
It's pretty simple if you've installed chrome in your system.. for running in debug mode, run this command in terminal
flutter run -d chrome
For running in release mode
flutter run -d chrome --release

Muhammad Waqas
- 179
- 7