SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
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.
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

Weitere ähnliche Inhalte

Was ist angesagt?

Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Priyanka Tyagi
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React NativeSambhu Lakshmanan
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastBartosz Kosarzycki
 
Flutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | EdurekaFlutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | EdurekaEdureka!
 
Flutter vs React Native | Edureka
Flutter vs React Native | EdurekaFlutter vs React Native | Edureka
Flutter vs React Native | EdurekaEdureka!
 
Flutter session 01
Flutter session 01Flutter session 01
Flutter session 01DSC IEM
 
Introduction to Flutter
Introduction to FlutterIntroduction to Flutter
Introduction to FlutterApoorv Pandey
 
A flight with Flutter
A flight with FlutterA flight with Flutter
A flight with FlutterAhmed Tarek
 
The magic of flutter
The magic of flutterThe magic of flutter
The magic of flutterShady Selim
 
INTRODUCTION TO FLUTTER.pdf
INTRODUCTION TO FLUTTER.pdfINTRODUCTION TO FLUTTER.pdf
INTRODUCTION TO FLUTTER.pdfAdarshMathuri
 

Was ist angesagt? (20)

Flutter introduction
Flutter introductionFlutter introduction
Flutter introduction
 
Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)
 
Flutter
FlutterFlutter
Flutter
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
Flutter
FlutterFlutter
Flutter
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fast
 
Flutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | EdurekaFlutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | Edureka
 
React Native
React Native React Native
React Native
 
Flutter vs React Native | Edureka
Flutter vs React Native | EdurekaFlutter vs React Native | Edureka
Flutter vs React Native | Edureka
 
Flutter session 01
Flutter session 01Flutter session 01
Flutter session 01
 
Introduction to Flutter
Introduction to FlutterIntroduction to Flutter
Introduction to Flutter
 
Flutter workshop
Flutter workshopFlutter workshop
Flutter workshop
 
Flutter
FlutterFlutter
Flutter
 
A flight with Flutter
A flight with FlutterA flight with Flutter
A flight with Flutter
 
The magic of flutter
The magic of flutterThe magic of flutter
The magic of flutter
 
React Native
React NativeReact Native
React Native
 
Flutter
FlutterFlutter
Flutter
 
INTRODUCTION TO FLUTTER.pdf
INTRODUCTION TO FLUTTER.pdfINTRODUCTION TO FLUTTER.pdf
INTRODUCTION TO FLUTTER.pdf
 
Flutter introduction
Flutter introductionFlutter introduction
Flutter introduction
 
What is Flutter
What is FlutterWhat is Flutter
What is Flutter
 

Ähnlich wie Everything about flutter web development

Build run first web application using flutter for web
Build run first web application using flutter for webBuild run first web application using flutter for web
Build run first web application using flutter for webConcetto Labs
 
Complete guide to flutter app development
Complete guide to flutter app developmentComplete guide to flutter app development
Complete guide to flutter app developmentConcetto Labs
 
Flutter App Development- Why Should You Choose It .
Flutter App Development- Why Should You Choose It .Flutter App Development- Why Should You Choose It .
Flutter App Development- Why Should You Choose It .Techugo
 
Ecommerce Mini Project / Group Project Coding
Ecommerce Mini Project / Group Project CodingEcommerce Mini Project / Group Project Coding
Ecommerce Mini Project / Group Project CodingHemant Sarthak
 
Getting Acquainted with PhoneGap
Getting Acquainted with PhoneGapGetting Acquainted with PhoneGap
Getting Acquainted with PhoneGapJoseph Labrecque
 
Asp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdfAsp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdfIntegrated IT Solutions
 
Flutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textFlutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textToma Velev
 
Web II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side developmentWeb II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side developmentRandy Connolly
 
10 Mobile Application Framework Must Know to Launch New App
10 Mobile Application Framework Must Know to Launch New App10 Mobile Application Framework Must Know to Launch New App
10 Mobile Application Framework Must Know to Launch New AppSonitek International
 
Top mobile app development frameworks to consider in 2021
Top mobile app development frameworks to consider in 2021Top mobile app development frameworks to consider in 2021
Top mobile app development frameworks to consider in 2021Katy Slemon
 
Building Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsBuilding Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsTroy Miles
 
Amazing vue.js projects that are open source and free.
Amazing vue.js projects that are open source and free.Amazing vue.js projects that are open source and free.
Amazing vue.js projects that are open source and free.Katy Slemon
 
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptxLATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptxchitrachauhan21
 
HTML5 introduction for beginners
HTML5 introduction for beginnersHTML5 introduction for beginners
HTML5 introduction for beginnersVineeth N Krishnan
 
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
JQuery Mobile vs Appcelerator Titanium vs Sencha TouchJQuery Mobile vs Appcelerator Titanium vs Sencha Touch
JQuery Mobile vs Appcelerator Titanium vs Sencha TouchSteve Drucker
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedsparkfabrik
 

Ähnlich wie Everything about flutter web development (20)

Build run first web application using flutter for web
Build run first web application using flutter for webBuild run first web application using flutter for web
Build run first web application using flutter for web
 
Complete guide to flutter app development
Complete guide to flutter app developmentComplete guide to flutter app development
Complete guide to flutter app development
 
dot net
dot netdot net
dot net
 
Flutter App Development- Why Should You Choose It .
Flutter App Development- Why Should You Choose It .Flutter App Development- Why Should You Choose It .
Flutter App Development- Why Should You Choose It .
 
Ecommerce Mini Project / Group Project Coding
Ecommerce Mini Project / Group Project CodingEcommerce Mini Project / Group Project Coding
Ecommerce Mini Project / Group Project Coding
 
Getting Acquainted with PhoneGap
Getting Acquainted with PhoneGapGetting Acquainted with PhoneGap
Getting Acquainted with PhoneGap
 
Asp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdfAsp Net Vs Vue JS Which One You Should Choose for Development.pdf
Asp Net Vs Vue JS Which One You Should Choose for Development.pdf
 
Flutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textFlutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - text
 
Web II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side developmentWeb II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side development
 
10 Mobile Application Framework Must Know to Launch New App
10 Mobile Application Framework Must Know to Launch New App10 Mobile Application Framework Must Know to Launch New App
10 Mobile Application Framework Must Know to Launch New App
 
Top mobile app development frameworks to consider in 2021
Top mobile app development frameworks to consider in 2021Top mobile app development frameworks to consider in 2021
Top mobile app development frameworks to consider in 2021
 
Asp.net Vs Vue.js.pdf
Asp.net Vs Vue.js.pdfAsp.net Vs Vue.js.pdf
Asp.net Vs Vue.js.pdf
 
Building Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsBuilding Cross-Platform Mobile Apps
Building Cross-Platform Mobile Apps
 
Phone gap
Phone gapPhone gap
Phone gap
 
Amazing vue.js projects that are open source and free.
Amazing vue.js projects that are open source and free.Amazing vue.js projects that are open source and free.
Amazing vue.js projects that are open source and free.
 
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptxLATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
 
Blazor Full-Stack
Blazor Full-StackBlazor Full-Stack
Blazor Full-Stack
 
HTML5 introduction for beginners
HTML5 introduction for beginnersHTML5 introduction for beginners
HTML5 introduction for beginners
 
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
JQuery Mobile vs Appcelerator Titanium vs Sencha TouchJQuery Mobile vs Appcelerator Titanium vs Sencha Touch
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I started
 

Mehr von Katy Slemon

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

Mehr von Katy Slemon (20)

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

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Kürzlich hochgeladen (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

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.
  • 7.
  • 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.