Lecture no. 12
Mobile Application development
Topics covered:
• Bloc
• Cubit
• River Pod
• Builder
• Future
• asycn
• Splash Screen
• Shared Preferences
• async*
• Future Builder
• Stream Builder
Bloc
It has three folders:
• bloc: Contains the business logic components.
• state: Contains the state classes representing the
various states of the application.
• event: Contains the event classes that trigger
state changes.
When an event is triggered, it initializes a state.
The bloc contains functions that handle these
events and manage the state transitions.
Cubit
Folders:
• bloc: Contains the business logic components.
• state: Contains the state classes representing the
various states of the application.
Purpose:
• Used as a simpler alternative to Bloc when Bloc brings
too much complexity.
Emit Function:
• Used in Cubit to emit new states and notify the UI of
state changes.
Riverpod
• Functionality:
– Acts like multi-threading, providing enhanced
state management capabilities.
– An enhanced version of Provider, offering more
features.
• Use Cases:
– Ideal for applications requiring instant state
changes, such as chat apps.
– Suitable for scenarios where request and response
handling need to be synchronized.
Builder
Used to conditionally wrap other widgets based on a
condition.
• Usage:
– Conditional Rendering:
• The Builder widget is used to conditionally render parts of the UI
based on certain conditions..
– Dialog Creation:
• By using the Builder widget to wrap a widget tree that includes an
AlertDialog or SimpleDialog, developers can easily create dialogs
that pop up over the main UI.
– State Management:
• The Builder widget can be used to manage state within a specific
part of the widget tree, allowing for more granular control over
state changes and updates.
Future
• In Flutter, a Future function is one that runs
first in a sequence of functions. For example, if
there are five functions and the fifth function
is a Future function, it will run first.
async
• An async function in Dart is a function that
performs asynchronous operations.
• It contains only one Future function and uses
the await keyword to pause execution until
the Future completes.
SplashScreen
A splash screen in Flutter is a screen that appears for a
short period when an app is launched.
• It includes an initState method that runs first when the
app is opened, allowing for initial setup.
• The Future.delayed function can be used within
initState to introduce a delay before loading the main
content, useful for showing branding or introductory
animations.
Shared Preferences
Shared Preferences in Flutter is a storage
solution for small amounts of data, similar to
how WhatsApp backs up chat history.
• Storage:
– It utilizes the device's storage, including libraries
like sqflite and Hive.
As it deals with a single entity, there's no need
for complex loading operations.
async*
• An async* function in Dart is used to create a
stream of values asynchronously.
• It can contain multiple Future functions,
allowing for the generation of multiple values
over time.
FutureBuilder
• Functionality:
– Used in Flutter to load and display data asynchronously.
– Requires specifying the data type expected from the
Future, especially important when using Firebase.
• Builder Method:
– The builder method of FutureBuilder must return a widget.
– It has two parameters: context and snapshot.
• Snapshot Parameter:
– Provides the state of the connection, indicating if the data
is loaded or if there's an error.
– Helps manage UI based on the state of the asynchronous
operation.
StreamBuilder
Used in Flutter for building UI based on stream data,
suitable for real-time updates like chat apps.
Preferred over FutureBuilder for chat apps to avoid
frequent loading.
• Usage:
– Specifies the stream using stream: APIClass.getData();,
with datatype required for Firebase.
– In the builder method, var data = snapshot.data; is used to
access the data.
– Data can be directly used or processed using a model
approach, which is considered better for organizing and
managing data.

More Related Content

ODP
Developing Microservices using Spring - Beginner's Guide
PPTX
Siebel Open UI Presentation
PPTX
O365 Developer Bootcamp NJ 2018 - Material
PPTX
Flutter presentation for Gujarat University
PPTX
Mobile Application Development class 006
PPTX
UI5con 2017 - UI5 Components - More Performance...
PPTX
Session 03_04-Working with React Native.pptx
PDF
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Developing Microservices using Spring - Beginner's Guide
Siebel Open UI Presentation
O365 Developer Bootcamp NJ 2018 - Material
Flutter presentation for Gujarat University
Mobile Application Development class 006
UI5con 2017 - UI5 Components - More Performance...
Session 03_04-Working with React Native.pptx
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments

Similar to Application Developmet lecture for backend (20)

PPTX
Introduction to react native with redux
PPTX
FlutterArchitecture FlutterArchitecture.ppt
PDF
Introduction to Flink Streaming
PPTX
FlutterArchitecture FlutterDevelopement (1).pptx
PPT
Migrating from Pivotal tc Server on-prem to IBM Liberty in the cloud
PPTX
Ultimate Guide to Microservice Architecture on Kubernetes
PPTX
Modern application development with oracle cloud sangam17
PDF
Angular meteor presentation
PPTX
Play with azure functions
PDF
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
PDF
Revue des annonces WWDC2015
PPT
Basics of R12 Oracle MWA/MSCA with steps
PPTX
An evening with React Native
PPTX
Cetas - Application Development Services
PPTX
Project COLA: Use Case to create a scalable application in the cloud based on...
PPT
D22 Portlet Development With Open Source Frameworks
PPT
D22 portlet development with open source frameworks
PPTX
Tips and tricks of the 2021.4 release
PPTX
Intro to Flutter SDK
PDF
Self-service PR-based Terraform
Introduction to react native with redux
FlutterArchitecture FlutterArchitecture.ppt
Introduction to Flink Streaming
FlutterArchitecture FlutterDevelopement (1).pptx
Migrating from Pivotal tc Server on-prem to IBM Liberty in the cloud
Ultimate Guide to Microservice Architecture on Kubernetes
Modern application development with oracle cloud sangam17
Angular meteor presentation
Play with azure functions
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Revue des annonces WWDC2015
Basics of R12 Oracle MWA/MSCA with steps
An evening with React Native
Cetas - Application Development Services
Project COLA: Use Case to create a scalable application in the cloud based on...
D22 Portlet Development With Open Source Frameworks
D22 portlet development with open source frameworks
Tips and tricks of the 2021.4 release
Intro to Flutter SDK
Self-service PR-based Terraform
Ad

Recently uploaded (20)

PPTX
Module on health assessment of CHN. pptx
PDF
Environmental Education MCQ BD2EE - Share Source.pdf
PDF
Mucosal Drug Delivery system_NDDS_BPHARMACY__SEM VII_PCI.pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
My India Quiz Book_20210205121199924.pdf
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PDF
advance database management system book.pdf
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
English Textual Question & Ans (12th Class).pdf
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
Module on health assessment of CHN. pptx
Environmental Education MCQ BD2EE - Share Source.pdf
Mucosal Drug Delivery system_NDDS_BPHARMACY__SEM VII_PCI.pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
My India Quiz Book_20210205121199924.pdf
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
B.Sc. DS Unit 2 Software Engineering.pptx
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
Paper A Mock Exam 9_ Attempt review.pdf.
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
advance database management system book.pdf
Unit 4 Computer Architecture Multicore Processor.pptx
Introduction to pro and eukaryotes and differences.pptx
English Textual Question & Ans (12th Class).pdf
FORM 1 BIOLOGY MIND MAPS and their schemes
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
Ad

Application Developmet lecture for backend

  • 1. Lecture no. 12 Mobile Application development
  • 2. Topics covered: • Bloc • Cubit • River Pod • Builder • Future • asycn • Splash Screen • Shared Preferences • async* • Future Builder • Stream Builder
  • 3. Bloc It has three folders: • bloc: Contains the business logic components. • state: Contains the state classes representing the various states of the application. • event: Contains the event classes that trigger state changes. When an event is triggered, it initializes a state. The bloc contains functions that handle these events and manage the state transitions.
  • 4. Cubit Folders: • bloc: Contains the business logic components. • state: Contains the state classes representing the various states of the application. Purpose: • Used as a simpler alternative to Bloc when Bloc brings too much complexity. Emit Function: • Used in Cubit to emit new states and notify the UI of state changes.
  • 5. Riverpod • Functionality: – Acts like multi-threading, providing enhanced state management capabilities. – An enhanced version of Provider, offering more features. • Use Cases: – Ideal for applications requiring instant state changes, such as chat apps. – Suitable for scenarios where request and response handling need to be synchronized.
  • 6. Builder Used to conditionally wrap other widgets based on a condition. • Usage: – Conditional Rendering: • The Builder widget is used to conditionally render parts of the UI based on certain conditions.. – Dialog Creation: • By using the Builder widget to wrap a widget tree that includes an AlertDialog or SimpleDialog, developers can easily create dialogs that pop up over the main UI. – State Management: • The Builder widget can be used to manage state within a specific part of the widget tree, allowing for more granular control over state changes and updates.
  • 7. Future • In Flutter, a Future function is one that runs first in a sequence of functions. For example, if there are five functions and the fifth function is a Future function, it will run first.
  • 8. async • An async function in Dart is a function that performs asynchronous operations. • It contains only one Future function and uses the await keyword to pause execution until the Future completes.
  • 9. SplashScreen A splash screen in Flutter is a screen that appears for a short period when an app is launched. • It includes an initState method that runs first when the app is opened, allowing for initial setup. • The Future.delayed function can be used within initState to introduce a delay before loading the main content, useful for showing branding or introductory animations.
  • 10. Shared Preferences Shared Preferences in Flutter is a storage solution for small amounts of data, similar to how WhatsApp backs up chat history. • Storage: – It utilizes the device's storage, including libraries like sqflite and Hive. As it deals with a single entity, there's no need for complex loading operations.
  • 11. async* • An async* function in Dart is used to create a stream of values asynchronously. • It can contain multiple Future functions, allowing for the generation of multiple values over time.
  • 12. FutureBuilder • Functionality: – Used in Flutter to load and display data asynchronously. – Requires specifying the data type expected from the Future, especially important when using Firebase. • Builder Method: – The builder method of FutureBuilder must return a widget. – It has two parameters: context and snapshot. • Snapshot Parameter: – Provides the state of the connection, indicating if the data is loaded or if there's an error. – Helps manage UI based on the state of the asynchronous operation.
  • 13. StreamBuilder Used in Flutter for building UI based on stream data, suitable for real-time updates like chat apps. Preferred over FutureBuilder for chat apps to avoid frequent loading. • Usage: – Specifies the stream using stream: APIClass.getData();, with datatype required for Firebase. – In the builder method, var data = snapshot.data; is used to access the data. – Data can be directly used or processed using a model approach, which is considered better for organizing and managing data.