Web support is a code-compatible implementation of Flutter that is rendered using standards-based web technologies: HTML, CSS and JavaScript. With web support, you can compile existing Flutter code written in Dart into a client experience that can be embedded in the browser and deployed to any web server. You can use all the features of Flutter, and you don’t need a browser plug-in.
To add web support to an existing app, or to create a new flutter mobile app development that includes web support.
– Install the Flutter SDK on your platform.
– Install Chrome. (Currently, debugging a web app requires the Chrome browser)
You can use the following steps to create a new project with web support.
Run the following commands to use the latest version of the Flutter SDK from the beta channel and enable web support:
Once the web is enabled, the flutter devices command outputs a Chrome device that opens the Chrome browser with your app running and a Web Server that provides the URL serving the app.
After enabling web support, restart your IDE. You should now see Chrome (web) in the device pull down.
To create a new app for use with web support (in addition to mobile support), run the following commands, substituting myapp with the name of your project:
flutter create myapp
3. Add your project name with lowercase letters and with Underscore.
4. Add your flutter SDK path and project location.
5. Click on Next your project will be Create.
To add web support to an existing project, run the following command in a terminal from the root project directory:
cd <your_directory>\flutter_newtest and then execute this command.
flutter create
To serve your app from localhost in Chrome, enter the following from the top of the package. We can run the app from two ways:
flutter run -d chrome
Run the following command to generate a release build:
flutter build web
A release build uses dart2js instead of the development compiler to produce a single JavaScript file main.dart.js. You can create a release build using release mode either by flutter run –release or by using flutter build web. This populates a build/web directory with built files, including an assets directory, which need to be served together.
This post will give you a basic idea and information about how we can integrate and use flutter for web app development.
Dhaiyur Makwana is Sr. Android/Flutter Developer at Rlogical Techsoft Pvt. Ltd. He is hardworking and dedicated person, love to explore, always have a big hunger for new knowledge. He is passionate about Android & Flutter and expert in building an innovative Android App Development.