flutter build web
- Flutter course
- Expert
- Lesson 27/39
- 4 min
Produce a web bundle with flutter build web.
flutter build web
The flutter build web command produces a production bundle for the web. It defaults to release mode; the output goes to the build/web/ folder. The --wasm flag produces a WebAssembly output.
// Terminal
flutter build web
flutter build web --wasmrelease mode
flutter build web always runs in release mode; there is no debug mode. The output is distributed as index.html, JS, and asset files under build/web/.
Practice Build command list
In main, define the command list ['flutter', 'build', 'web']. Print the last element with print.
Starter code
void main() {
// flutter, build, web elemanlarından oluşan cmd listesi tanımla
// son elemanını yazdır
}Sample solution
void main() {
final cmd = ['flutter', 'build', 'web'];
print(cmd.last);
}Expected output
web
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 What does flutter build web produce?
- iOS IPA
- Windows EXE
- Android APK
- Web production bundle Correct answer
Explanation: flutter build web produces a web production bundle in the build/web folder; IPA is for iOS, APK for Android, and EXE for Windows.
2 --wasm flag
flutter build web ____
flutter build web --wasm
Explanation: --wasm produces a WebAssembly output; --release is the default mode, --debug does not exist for web, and --html is not a build flag but a renderer flag.
3 flutter build web matches
| Term | Meaning |
|---|---|
build_web |
Web bundle build |
release |
Production mode |
wasm |
WebAssembly output |
build/web |
Output folder |