Mobility

Flutter Web App Commands – Cheatsheet

In this post, I will list down some of the key commands (cheatsheet) which can help one build and release web application (app) using Flutter.  

In order for the following commands to work, follow the steps given below:

Flutter Commands for Web

Once flutter is set up and a template project is created, execute the following one-time commands for setting up Flutter web development environment. These commands can be run from anywhere in a terminal.

flutter channel beta
flutter upgrade
flutter config --enable-web

Once the above commands executed, go to the home / root folder of Flutter project and execute the following commands. The details of these commands can be found on this page titled as building web application using flutter.

Run the Flutter Project

flutter run -d chrome

Build the Web Project

flutter build web

Create Release Build

The command given below will populate build/web directory with built files, including an assets directory, which need to be served together. One should note that the minification is handled when one creates a release build.

flutter run --release
# The following command can also be used
flutter build web

The release build will create the following files / assets in build/web project folder. Take these files and put it in web root folder for any web server including Tomcat, Python, Firebase or cloud hosting (AWS, Google, Azure). More details can be found on this page related to deploying flutter app on web

/build/web
  assets
    AssetManifest.json
    FontManifest.json
    LICENSE
    fonts
      MaterialIcons-Regular.ttf
      <other font files>
    <image files>
  index.html
  main.dart.js
  main.dart.js.map

Add Web Support to an Existing Project

flutter create .

Embed Flutter App in Web Page

Use the following command to embed flutter app in any webpage. URL is the link for flutter web page.

<iframe src="URL"></iframe>
Ajitesh Kumar

I have been recently working in the area of Data analytics including Data Science and Machine Learning / Deep Learning. I am also passionate about different technologies including programming languages such as Java/JEE, Javascript, Python, R, Julia, etc, and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data, etc. I would love to connect with you on Linkedin. Check out my latest book titled as First Principles Thinking: Building winning products using first principles thinking.

Share
Published by
Ajitesh Kumar

Recent Posts

Coefficient of Variation in Regression Modelling: Example

When building a regression model or performing regression analysis to predict a target variable, understanding…

2 weeks ago

Chunking Strategies for RAG with Examples

If you've built a "Naive" RAG pipeline, you've probably hit a wall. You've indexed your…

3 weeks ago

RAG Pipeline: 6 Steps for Creating Naive RAG App

If you're starting with large language models, you must have heard of RAG (Retrieval-Augmented Generation).…

3 weeks ago

Python: List Comprehension Explained with Examples

If you've spent any time with Python, you've likely heard the term "Pythonic." It refers…

3 weeks ago

Large Language Models (LLMs): Four Critical Modeling Stages

Large language models (LLMs) have fundamentally transformed our digital landscape, powering everything from chatbots and…

4 months ago

Agentic Workflow Design Patterns Explained with Examples

As Large Language Models (LLMs) evolve into autonomous agents, understanding agentic workflow design patterns has…

4 months ago