SlideShare a Scribd company logo
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

Similar to Application Developmet lecture for backend

D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
Sunil Patil
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworks
Sunil Patil
 

Similar to Application Developmet lecture for backend (20)

Introduction to Flink Streaming
Introduction to Flink StreamingIntroduction to Flink Streaming
Introduction to Flink Streaming
 
Migrating from Pivotal tc Server on-prem to IBM Liberty in the cloud
Migrating from Pivotal tc Server on-prem to IBM Liberty in the cloudMigrating from Pivotal tc Server on-prem to IBM Liberty in the cloud
Migrating from Pivotal tc Server on-prem to IBM Liberty in the cloud
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 
Modern application development with oracle cloud sangam17
Modern application development with oracle cloud sangam17Modern application development with oracle cloud sangam17
Modern application development with oracle cloud sangam17
 
Angular meteor presentation
Angular meteor presentationAngular meteor presentation
Angular meteor presentation
 
Play with azure functions
Play with azure functionsPlay with azure functions
Play with azure functions
 
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
 
Revue des annonces WWDC2015
Revue des annonces WWDC2015Revue des annonces WWDC2015
Revue des annonces WWDC2015
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React Native
 
Cetas - Application Development Services
Cetas - Application Development ServicesCetas - Application Development Services
Cetas - Application Development Services
 
Project COLA: Use Case to create a scalable application in the cloud based on...
Project COLA: Use Case to create a scalable application in the cloud based on...Project COLA: Use Case to create a scalable application in the cloud based on...
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 FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworks
 
Tips and tricks of the 2021.4 release
Tips and tricks of the 2021.4 releaseTips and tricks of the 2021.4 release
Tips and tricks of the 2021.4 release
 
Intro to Flutter SDK
Intro to Flutter SDKIntro to Flutter SDK
Intro to Flutter SDK
 
Self-service PR-based Terraform
Self-service PR-based TerraformSelf-service PR-based Terraform
Self-service PR-based Terraform
 
Web technology and commerce unit 2
Web technology and commerce unit 2Web technology and commerce unit 2
Web technology and commerce unit 2
 
Synchronizing application state using Virtual DOM trees
Synchronizing application state using Virtual DOM treesSynchronizing application state using Virtual DOM trees
Synchronizing application state using Virtual DOM trees
 
Krishnagopal Thogiti_Java
Krishnagopal Thogiti_JavaKrishnagopal Thogiti_Java
Krishnagopal Thogiti_Java
 
Integration Monday - BizTalk Migrator Deep Dive
Integration Monday - BizTalk Migrator Deep DiveIntegration Monday - BizTalk Migrator Deep Dive
Integration Monday - BizTalk Migrator Deep Dive
 

Recently uploaded

Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
Avinash Rai
 
IATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdffIATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdff
17thcssbs2
 
ppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyesppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyes
ashishpaul799
 

Recently uploaded (20)

2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceutics
 
How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Advances in production technology of Grapes.pdf
Advances in production technology of Grapes.pdfAdvances in production technology of Grapes.pdf
Advances in production technology of Grapes.pdf
 
The Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational ResourcesThe Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational Resources
 
Morse OER Some Benefits and Challenges.pptx
Morse OER Some Benefits and Challenges.pptxMorse OER Some Benefits and Challenges.pptx
Morse OER Some Benefits and Challenges.pptx
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringBasic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
 
IATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdffIATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdff
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptx
 
ppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyesppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyes
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPoint
 
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
 

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.