SlideShare a Scribd company logo
www.bacancytechnology.com
Google’s UI library- Flutter, was initially
developed to build native performant
mobile applications. Nonetheless, Flutter
isn’t limited to just mobile applications; it
has been working proactively to use the
single codebase for iOS, Android, and
Desktop. Are you passionate about Web
Development? You should definitely try out
Flutter for Web then!
In this guide, we will learn about Flutter for
Web and build a small demo for the same.
Without further ado, let’s get started with
Flutter Web development!
What is
Flutter for
Web?
Flutter’s web support helps you
develop complex standalone web
applications, graphically rich and
interactive content to reach end-users
on a broad variety of devices.
Flutter for Web support offers a
delivery model based on browsers for
the existing Flutter mobile
applications.
How does
Flutter for
Web work?
Flutter renders web apps the same way
as it will render your android/iOS apps,
i.e., Flutter Web will convert your
project to native code (HTML, CSS, JS)
when you wish to deploy. Now, keep in
mind that Flutter Web creates Single
Page Web Applications! You can
definitely have multi-pages, but when
the Flutter framework converts the web
app into the native language, there will
only be one HTML file, i.e., index.html.
So how do we have multiple pages? The
answer to this question is pretty simple.
If we have a closer look at how
Navigator works, we will observe that it
works on the Stack data structure.
Hence, Flutter for Web is a single page,
but it pushes multiple pages on that
same single native page.
Everything about flutter web development
How is the
performance
for Flutter
Web, and how
is it different?
Flutter Web works pretty smooth
compared to native as it creates only a
single-page application and hence
creates less load on the browser. Though
we can say that Flutter Web is
improving, its performance is not upto
the mark.
With Flutter, you can create some great
animations very easily compared to
native, hence making your web app
more beautiful.
Flutter Web directly supports installing
your website as a standalone
application (Web-App) for which you
need to code, if in native, separately.
Flutter, as it is a cross-platform
framework, can add some platform-
specific code without any configuration
changes.
How to run
your existing
project on
Flutter Web?
Flutter Web is now on the stable
channel from Flutter 2.0!
Nevertheless, if you are not working on
Flutter 2.0, you can still use it by
running the below commands:
flutter channel beta
flutter upgrade
flutter config --enable-web
flutter create .
If you are already on Flutter 2.0 but
have never run your old project on the
Web, you can run the following set of
commands:
flutter config --enable-web
flutter create
Once the commands are successfully
executed, your project is ready to set
fire on the Web! You will be able to see a
Web folder in your project directory.
Now, to run your project on the Web,
simply select Chrome or Edge as your
device and click Run.
How to create
a new app
with Web
support?
When we create our new project with
Flutter 2.0, web support is already
enabled with new projects.
But if, for some reason, it’s not enabled,
you can run the following commands:
Now Web has been enabled in your
project, and you can run it directly.
flutter config --enable-web
flutter create
Some key
points you
must
consider
when using
Flutter Web!
Flutter Web creates a Single Page App!
As users can open your website in any
screen size now, you need to make it
responsive.
Many packages support the web, but
always check the supported platforms
before coding.
If you are from a web development
background and if you feel like making
any changes in native code, you are
highly welcomed to do so. You can
change the native code the same way we
can change it for Android and iOS.
When you want to deploy your web app,
you can simply run:
When you are working with Flutter Web,
you need to keep few points in mind:
flutter build web
And you will get a folder web in your
project directory that contains native codes,
including index.html
Quick Read: :Flutter for App Development
Tips and
Tricks to
make your
web app
responsive!
The best way to make your web app
responsive is to use MediaQuery to get
the height and width of the screen, and
based on that; you can assign font size.
Many other packages help you to make
your app responsive. Some of the most
useful packages are
➢ responsive_framework
➢ flutter_screenutil
Let’s make a
small
responsive
web app for
all screen
sizes.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key:
key);
@override
_HomePageState createState() =>
_HomePageState();
}
}
Create a new project and delete all code
available in main.dart
Paste the following code in main.dart:
class _HomePageState extends
State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
height: MediaQuery.of(context).size.height
- 100.0,
width: MediaQuery.of(context).size.width -
100.0,
color: Colors.orange,
child: Text(
'Responsive Text',
style: TextStyle(fontSize:
MediaQuery.of(context).size.width / 10),
),
),
);
}
class _HomePageState extends
State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
height: MediaQuery.of(context).size.height
- 100.0,
width: MediaQuery.of(context).size.width -
100.0,
color: Colors.orange,
child: Text(
'Responsive Text',
style: TextStyle(fontSize:
MediaQuery.of(context).size.width / 10),
),
),
);
}
The code is pretty simple. There’s one
Container whose height and width are
being maintained using MediaQuery.
We have Text as its child whose fontSize
is maintained using MediaQuery. Now,
you can check whether this project is
responsive or not by simply increasing
and decreasing the size of your browser!
You can find the entire source code, clone
the Github Repository and run it on your
system.
Conclusion
Flutter for Web Apps are Single Page
Apps.
Flutter renders web apps the same as it
renders Flutter Android or iOS apps by
converting dart code into native code.
We need to check whether a particular
package has Web Support before using it
in our project.
Always make your Web App responsive
as users can open it in any screen size.
Bacancy has dedicated and enthusiastic
Flutter developers enriched with
fundamental and advanced knowledge. If
you’re looking for a helping hand for your
Flutter application, contact us and hire
Flutter developers.
Thank You
www.bacancytechnology.com

More Related Content

PDF
Flutter for web
PPTX
Flutter workshop
PDF
Build web applications using google flutter
PDF
flutter.school #HelloWorld
PPTX
Flutter introduction
PPTX
Introduction to Flutter
PPTX
Front-end technologies for Wonderful User Experience through Websites
PDF
Getting started with flutter
Flutter for web
Flutter workshop
Build web applications using google flutter
flutter.school #HelloWorld
Flutter introduction
Introduction to Flutter
Front-end technologies for Wonderful User Experience through Websites
Getting started with flutter

What's hot (20)

PDF
The Architecture of an API Platform
PPTX
PPTX
Flutter talkshow
PDF
Android datastorage
PPTX
Flutter Festival - Intro Session
PDF
INTRODUCTION TO FLUTTER.pdf
PPTX
Building APIs with Apigee Edge and Microsoft Azure
PPTX
Introduction to Flutter.pptx
PPTX
What and Why Flutter? What is a Widget in Flutter?
PDF
Test Automation Using Python | Edureka
PPTX
Flutter Session GDSC BPIT.pptx
PDF
Introduction to flutter
PDF
Introduction to Firebase from Google
PPTX
Api gateway in microservices
PDF
Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)
PPTX
What is Flutter
PPTX
Flutter
PPTX
Flutter
PDF
Flutter state management from zero to hero
PPTX
Google Firebase Presentation
The Architecture of an API Platform
Flutter talkshow
Android datastorage
Flutter Festival - Intro Session
INTRODUCTION TO FLUTTER.pdf
Building APIs with Apigee Edge and Microsoft Azure
Introduction to Flutter.pptx
What and Why Flutter? What is a Widget in Flutter?
Test Automation Using Python | Edureka
Flutter Session GDSC BPIT.pptx
Introduction to flutter
Introduction to Firebase from Google
Api gateway in microservices
Pipelines and Packages: Introduction to Azure Data Factory (DATA:Scotland 2019)
What is Flutter
Flutter
Flutter
Flutter state management from zero to hero
Google Firebase Presentation
Ad

Similar to Everything about flutter web development (20)

PPTX
Build run first web application using flutter for web
PDF
Flutter for Web - A Comprehensive Outline.pdf
DOCX
Flutter web development at Reasonable Price
PPTX
How to Develop Progressive Web Apps in Flutter – Step by Step Guide.pptx
PPTX
Complete guide to flutter app development
PDF
Is Flutter Good for Web Development? | Flutter Agency
PDF
How to successfully build a Flutter web app?
PPTX
Introduction to flutter's basic concepts
PDF
Native mobile application development with Flutter (Dart)
PPTX
GoogleDSC_ GHRCE_ flutter_firebase.pptx
PDF
Developing cross platform apps in Flutter (Android, iOS, and Web)
PPTX
Flutter vs ReactNative
PDF
Build beautiful native apps in record time with flutter
PDF
Learn Google Flutter Fast: 65 Example Apps Mark Clow
PDF
Developing Cross platform apps in flutter (Android, iOS, Web)
PDF
Google flutter app development
PPTX
Flutter_ Introduction _Presentation.pptx
PDF
Flutter for Web App Development: Exploring the Possibilities
PPTX
SFHTML5 - Flutter for web developers.pptx
PPTX
Topic name. React Native Vs Flutter.pptx
Build run first web application using flutter for web
Flutter for Web - A Comprehensive Outline.pdf
Flutter web development at Reasonable Price
How to Develop Progressive Web Apps in Flutter – Step by Step Guide.pptx
Complete guide to flutter app development
Is Flutter Good for Web Development? | Flutter Agency
How to successfully build a Flutter web app?
Introduction to flutter's basic concepts
Native mobile application development with Flutter (Dart)
GoogleDSC_ GHRCE_ flutter_firebase.pptx
Developing cross platform apps in Flutter (Android, iOS, and Web)
Flutter vs ReactNative
Build beautiful native apps in record time with flutter
Learn Google Flutter Fast: 65 Example Apps Mark Clow
Developing Cross platform apps in flutter (Android, iOS, Web)
Google flutter app development
Flutter_ Introduction _Presentation.pptx
Flutter for Web App Development: Exploring the Possibilities
SFHTML5 - Flutter for web developers.pptx
Topic name. React Native Vs Flutter.pptx
Ad

More from Katy Slemon (20)

PDF
React Alternatives Frameworks- Lightweight Javascript Libraries.pdf
PDF
Data Science Use Cases in Retail & Healthcare Industries.pdf
PDF
How Much Does It Cost To Hire Golang Developer.pdf
PDF
What’s New in Flutter 3.pdf
PDF
Why Use Ruby On Rails.pdf
PDF
How Much Does It Cost To Hire Full Stack Developer In 2022.pdf
PDF
How to Implement Middleware Pipeline in VueJS.pdf
PDF
How to Build Laravel Package Using Composer.pdf
PDF
Sure Shot Ways To Improve And Scale Your Node js Performance.pdf
PDF
How to Develop Slack Bot Using Golang.pdf
PDF
IoT Based Battery Management System in Electric Vehicles.pdf
PDF
Understanding Flexbox Layout in React Native.pdf
PDF
The Ultimate Guide to Laravel Performance Optimization in 2022.pdf
PDF
New Features in iOS 15 and Swift 5.5.pdf
PDF
How to Hire & Manage Dedicated Team For Your Next Product Development.pdf
PDF
Choose the Right Battery Management System for Lithium Ion Batteries.pdf
PDF
Flutter Performance Tuning Best Practices From the Pros.pdf
PDF
Angular Universal How to Build Angular SEO Friendly App.pdf
PDF
How to Set Up and Send Mails Using SendGrid in NodeJs App.pdf
PDF
Ruby On Rails Performance Tuning Guide.pdf
React Alternatives Frameworks- Lightweight Javascript Libraries.pdf
Data Science Use Cases in Retail & Healthcare Industries.pdf
How Much Does It Cost To Hire Golang Developer.pdf
What’s New in Flutter 3.pdf
Why Use Ruby On Rails.pdf
How Much Does It Cost To Hire Full Stack Developer In 2022.pdf
How to Implement Middleware Pipeline in VueJS.pdf
How to Build Laravel Package Using Composer.pdf
Sure Shot Ways To Improve And Scale Your Node js Performance.pdf
How to Develop Slack Bot Using Golang.pdf
IoT Based Battery Management System in Electric Vehicles.pdf
Understanding Flexbox Layout in React Native.pdf
The Ultimate Guide to Laravel Performance Optimization in 2022.pdf
New Features in iOS 15 and Swift 5.5.pdf
How to Hire & Manage Dedicated Team For Your Next Product Development.pdf
Choose the Right Battery Management System for Lithium Ion Batteries.pdf
Flutter Performance Tuning Best Practices From the Pros.pdf
Angular Universal How to Build Angular SEO Friendly App.pdf
How to Set Up and Send Mails Using SendGrid in NodeJs App.pdf
Ruby On Rails Performance Tuning Guide.pdf

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
cuic standard and advanced reporting.pdf
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Approach and Philosophy of On baking technology
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Modernizing your data center with Dell and AMD
PPT
Teaching material agriculture food technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
Advanced methodologies resolving dimensionality complications for autism neur...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
cuic standard and advanced reporting.pdf
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Approach and Philosophy of On baking technology
Empathic Computing: Creating Shared Understanding
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
“AI and Expert System Decision Support & Business Intelligence Systems”
Modernizing your data center with Dell and AMD
Teaching material agriculture food technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Unlocking AI with Model Context Protocol (MCP)
20250228 LYD VKU AI Blended-Learning.pptx
GamePlan Trading System Review: Professional Trader's Honest Take

Everything about flutter web development

  • 2. Google’s UI library- Flutter, was initially developed to build native performant mobile applications. Nonetheless, Flutter isn’t limited to just mobile applications; it has been working proactively to use the single codebase for iOS, Android, and Desktop. Are you passionate about Web Development? You should definitely try out Flutter for Web then! In this guide, we will learn about Flutter for Web and build a small demo for the same. Without further ado, let’s get started with Flutter Web development!
  • 4. Flutter’s web support helps you develop complex standalone web applications, graphically rich and interactive content to reach end-users on a broad variety of devices. Flutter for Web support offers a delivery model based on browsers for the existing Flutter mobile applications.
  • 6. Flutter renders web apps the same way as it will render your android/iOS apps, i.e., Flutter Web will convert your project to native code (HTML, CSS, JS) when you wish to deploy. Now, keep in mind that Flutter Web creates Single Page Web Applications! You can definitely have multi-pages, but when the Flutter framework converts the web app into the native language, there will only be one HTML file, i.e., index.html. So how do we have multiple pages? The answer to this question is pretty simple. If we have a closer look at how Navigator works, we will observe that it works on the Stack data structure. Hence, Flutter for Web is a single page, but it pushes multiple pages on that same single native page.
  • 8. How is the performance for Flutter Web, and how is it different?
  • 9. Flutter Web works pretty smooth compared to native as it creates only a single-page application and hence creates less load on the browser. Though we can say that Flutter Web is improving, its performance is not upto the mark. With Flutter, you can create some great animations very easily compared to native, hence making your web app more beautiful. Flutter Web directly supports installing your website as a standalone application (Web-App) for which you need to code, if in native, separately. Flutter, as it is a cross-platform framework, can add some platform- specific code without any configuration changes.
  • 10. How to run your existing project on Flutter Web?
  • 11. Flutter Web is now on the stable channel from Flutter 2.0! Nevertheless, if you are not working on Flutter 2.0, you can still use it by running the below commands: flutter channel beta flutter upgrade flutter config --enable-web flutter create . If you are already on Flutter 2.0 but have never run your old project on the Web, you can run the following set of commands: flutter config --enable-web flutter create
  • 12. Once the commands are successfully executed, your project is ready to set fire on the Web! You will be able to see a Web folder in your project directory. Now, to run your project on the Web, simply select Chrome or Edge as your device and click Run.
  • 13. How to create a new app with Web support?
  • 14. When we create our new project with Flutter 2.0, web support is already enabled with new projects. But if, for some reason, it’s not enabled, you can run the following commands: Now Web has been enabled in your project, and you can run it directly. flutter config --enable-web flutter create
  • 16. Flutter Web creates a Single Page App! As users can open your website in any screen size now, you need to make it responsive. Many packages support the web, but always check the supported platforms before coding. If you are from a web development background and if you feel like making any changes in native code, you are highly welcomed to do so. You can change the native code the same way we can change it for Android and iOS. When you want to deploy your web app, you can simply run: When you are working with Flutter Web, you need to keep few points in mind:
  • 17. flutter build web And you will get a folder web in your project directory that contains native codes, including index.html Quick Read: :Flutter for App Development
  • 18. Tips and Tricks to make your web app responsive!
  • 19. The best way to make your web app responsive is to use MediaQuery to get the height and width of the screen, and based on that; you can assign font size. Many other packages help you to make your app responsive. Some of the most useful packages are ➢ responsive_framework ➢ flutter_screenutil
  • 20. Let’s make a small responsive web app for all screen sizes.
  • 21. import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Material App', home: HomePage(), ); } } class HomePage extends StatefulWidget { const HomePage({Key? key}) : super(key: key); @override _HomePageState createState() => _HomePageState(); } } Create a new project and delete all code available in main.dart Paste the following code in main.dart:
  • 22. class _HomePageState extends State<HomePage> { @override Widget build(BuildContext context) { return Scaffold( body: Container( height: MediaQuery.of(context).size.height - 100.0, width: MediaQuery.of(context).size.width - 100.0, color: Colors.orange, child: Text( 'Responsive Text', style: TextStyle(fontSize: MediaQuery.of(context).size.width / 10), ), ), ); }
  • 23. class _HomePageState extends State<HomePage> { @override Widget build(BuildContext context) { return Scaffold( body: Container( height: MediaQuery.of(context).size.height - 100.0, width: MediaQuery.of(context).size.width - 100.0, color: Colors.orange, child: Text( 'Responsive Text', style: TextStyle(fontSize: MediaQuery.of(context).size.width / 10), ), ), ); }
  • 24. The code is pretty simple. There’s one Container whose height and width are being maintained using MediaQuery. We have Text as its child whose fontSize is maintained using MediaQuery. Now, you can check whether this project is responsive or not by simply increasing and decreasing the size of your browser! You can find the entire source code, clone the Github Repository and run it on your system.
  • 26. Flutter for Web Apps are Single Page Apps. Flutter renders web apps the same as it renders Flutter Android or iOS apps by converting dart code into native code. We need to check whether a particular package has Web Support before using it in our project. Always make your Web App responsive as users can open it in any screen size. Bacancy has dedicated and enthusiastic Flutter developers enriched with fundamental and advanced knowledge. If you’re looking for a helping hand for your Flutter application, contact us and hire Flutter developers.