SlideShare a Scribd company logo
Poznan Flutter Developer Group
Poznan Flutter Developer Group
Poznan Flutter Developer Group
Poznan Flutter Developer Group
Poznan Flutter Developer Group
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
ChangeNotifierProvider(builder: (context) =>
UserLogin()),
//hint: other providers go here
],
child: Scaffold(
appBar: AppBar( …. )
)
);
}
class UserLogin with ChangeNotifier {
String _user;
….
}
UserLogin userLogin = Provider.of<UserLogin>(context);
userLogin.someAction();
userLogin.notifyListeners(); // usually inside another method
Poznan Flutter Developer Group
Poznan Flutter Developer Group
Poznan Flutter Developer Group
class UserSignInBloc {
Sink<UserLogin> get login => _userCredentialsStream.sink;
final _userCredentialsStream = BehaviorSubject<UserLogin>();
Stream<UserAuthenticationState> userSigned;
UserSignInBloc() {
userSigned = Observable.merge([
_userCredentialsStream.stream.switchMap(_signIn),
// other login methods go here
]).asBroadcastStream();
}
void dispose() {
_userCredentialsStream.close();
}
// Business logic here
}
_userSignInBloc.login.add(UserLogin(user, password));
Poznan Flutter Developer Group
var _userSignInBloc = UserSignInBloc();
ResultWidget(_userSignInBloc.userSigned),
class ResultWidget extends StatefulWidget {
Stream<UserAuthenticationState> userSigned;
ResultWidget(this.userSigned);
@override
_ResultWidgetState createState() => _ResultWidgetState(userSigned);
}
class _ResultWidgetState extends State<ResultWidget> {
var loginResultText = "";
_ResultWidgetState(Stream<UserAuthenticationState> userSigned){
userSigned.listen(onLoginDataChanged);
}
void onLoginDataChanged(UserAuthenticationState event) {
if (event is UserAuthenticationLoading) {
setState(() {
loginResultText = "LOADING...";
});
}
}
Poznan Flutter Developer Group
Poznan Flutter Developer Group
Poznan Flutter Developer Group
Poznan Flutter Developer Group
Poznan Flutter Developer Group
Poznan Flutter Developer Group
final store = Store<AppState>(
appReducer,
initialState: AppState.noLoggedUser(),
middleware: createStoreLoginMiddleware(),
);
@override
Widget build(BuildContext context) {
return StoreProvider(
store: store,
child: MaterialApp( … )
);
}
UserLogin user = StoreProvider.of<AppState>(context).state.loggedUser;
StoreProvider.of<AppState>(context).dispatch(LoginRequestAction(user,
password));
class LoginUnsuccessfulAction {}
TypedReducer<UserLogin, LoginSuccessfulAction>(_setUser)
UserLogin _setUser(UserLogin user, LoginSuccessfulAction action) {
print("Previous user: $user , storing new user: ${action.user}");
return action.user;
}
Poznan Flutter Developer Group
Poznan Flutter Developer Group
Poznan Flutter Developer Group
Poznan Flutter Developer Group
https://github.com/kosiara/bloc-vs-pprov-vs-redux
Poznan Flutter Developer Group
Bartosz Kosarzycki
Poznań Flutter Developer Group
facebook.com/poznanflutter
meetup.com/poznan-flutter-developers
Poznan Flutter Developer Group
https://redux.js.org/introduction/three-principles
https://www.youtube.com/watch?v=Zbm3hjPjQMk
https://www.udemy.com/course/react-redux/
https://medium.com/flutter-community/flutter-pragmatic-state-
management-using-provider-5c1129f9b5bb
https://pub.dev/packages/provider

More Related Content

What's hot

Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
Stoyan Stefanov
 
Flutter
FlutterFlutter
Flutter
Mohit Sharma
 
Flutter Bootcamp
Flutter BootcampFlutter Bootcamp
Flutter beyond hello world
Flutter beyond hello worldFlutter beyond hello world
Flutter beyond hello world
Ahmed Abu Eldahab
 
Android Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - IntroductionAndroid Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - Introduction
Andreas Jakl
 
SwiftUI and Combine All the Things
SwiftUI and Combine All the ThingsSwiftUI and Combine All the Things
SwiftUI and Combine All the Things
Scott Gardner
 
JUnit 4
JUnit 4JUnit 4
JUnit 4
Sunil OS
 
Introduction to Android Fragments
Introduction to Android FragmentsIntroduction to Android Fragments
Introduction to Android Fragments
Sergi Martínez
 
Recyclerview in action
Recyclerview in action Recyclerview in action
Recyclerview in action
Pratama Nur Wijaya
 
jQuery
jQueryjQuery
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
Vladimir Parfenov
 
Webauthn Tutorial
Webauthn TutorialWebauthn Tutorial
Webauthn Tutorial
FIDO Alliance
 
알아보자 Dependency Injection과 Deli
알아보자 Dependency Injection과 Deli알아보자 Dependency Injection과 Deli
알아보자 Dependency Injection과 Deli
Jungwon An
 
React js
React jsReact js
React js
Rajesh Kolla
 
What and Why Flutter? What is a Widget in Flutter?
What and Why Flutter? What is a Widget in Flutter?What and Why Flutter? What is a Widget in Flutter?
What and Why Flutter? What is a Widget in Flutter?
MohammadHussain595488
 
Flutter
FlutterFlutter
Flutter
Toma Velev
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
Joshua Long
 
Choosing The Best Mobile App Framework
Choosing The Best Mobile App FrameworkChoosing The Best Mobile App Framework
Choosing The Best Mobile App Framework
Brandon Minnick, MBA
 
Data Persistence in Android with Room Library
Data Persistence in Android with Room LibraryData Persistence in Android with Room Library
Data Persistence in Android with Room Library
Reinvently
 
Jetpack Navigation Component
Jetpack Navigation ComponentJetpack Navigation Component
Jetpack Navigation Component
James Shvarts
 

What's hot (20)

Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
Flutter
FlutterFlutter
Flutter
 
Flutter Bootcamp
Flutter BootcampFlutter Bootcamp
Flutter Bootcamp
 
Flutter beyond hello world
Flutter beyond hello worldFlutter beyond hello world
Flutter beyond hello world
 
Android Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - IntroductionAndroid Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - Introduction
 
SwiftUI and Combine All the Things
SwiftUI and Combine All the ThingsSwiftUI and Combine All the Things
SwiftUI and Combine All the Things
 
JUnit 4
JUnit 4JUnit 4
JUnit 4
 
Introduction to Android Fragments
Introduction to Android FragmentsIntroduction to Android Fragments
Introduction to Android Fragments
 
Recyclerview in action
Recyclerview in action Recyclerview in action
Recyclerview in action
 
jQuery
jQueryjQuery
jQuery
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
 
Webauthn Tutorial
Webauthn TutorialWebauthn Tutorial
Webauthn Tutorial
 
알아보자 Dependency Injection과 Deli
알아보자 Dependency Injection과 Deli알아보자 Dependency Injection과 Deli
알아보자 Dependency Injection과 Deli
 
React js
React jsReact js
React js
 
What and Why Flutter? What is a Widget in Flutter?
What and Why Flutter? What is a Widget in Flutter?What and Why Flutter? What is a Widget in Flutter?
What and Why Flutter? What is a Widget in Flutter?
 
Flutter
FlutterFlutter
Flutter
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
Choosing The Best Mobile App Framework
Choosing The Best Mobile App FrameworkChoosing The Best Mobile App Framework
Choosing The Best Mobile App Framework
 
Data Persistence in Android with Room Library
Data Persistence in Android with Room LibraryData Persistence in Android with Room Library
Data Persistence in Android with Room Library
 
Jetpack Navigation Component
Jetpack Navigation ComponentJetpack Navigation Component
Jetpack Navigation Component
 

Similar to Provider vs BLoC vs Redux

Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805LearningTech
 
Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805LearningTech
 
Codemotion appengine
Codemotion appengineCodemotion appengine
Codemotion appengine
Ignacio Coloma
 
softshake 2014 - Java EE
softshake 2014 - Java EEsoftshake 2014 - Java EE
softshake 2014 - Java EE
Alexis Hassler
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
Jonathan Wage
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
Lukas Smith
 
Application Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The UglyApplication Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The Ugly
Richard Lord
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
Konstantin Kudryashov
 
CDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptorCDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptor
Caelum
 
Distributing information on iOS
Distributing information on iOSDistributing information on iOS
Distributing information on iOS
Make School
 
CDI @javaonehyderabad
CDI @javaonehyderabadCDI @javaonehyderabad
CDI @javaonehyderabad
Prasad Subramanian
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
Darren Craig
 
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
Daniel Bryant
 
Rcp by example
Rcp by exampleRcp by example
Rcp by example
tsubramanian80
 
Architecting your GWT applications with GWT-Platform - Lesson 02
Architecting your GWT applications with GWT-Platform - Lesson 02Architecting your GWT applications with GWT-Platform - Lesson 02
Architecting your GWT applications with GWT-Platform - Lesson 02
rhemsolutions
 
Introduction to cdi given at java one 2014
Introduction to cdi given at java one 2014Introduction to cdi given at java one 2014
Introduction to cdi given at java one 2014Antoine Sabot-Durand
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf Conference
 
Dependency Injection and Pimple
Dependency Injection and PimpleDependency Injection and Pimple
Dependency Injection and Pimple
DQNEO
 

Similar to Provider vs BLoC vs Redux (20)

Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805
 
Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805Design pattern proxy介紹 20130805
Design pattern proxy介紹 20130805
 
Codemotion appengine
Codemotion appengineCodemotion appengine
Codemotion appengine
 
softshake 2014 - Java EE
softshake 2014 - Java EEsoftshake 2014 - Java EE
softshake 2014 - Java EE
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
Application Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The UglyApplication Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The Ugly
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
 
Deployment
DeploymentDeployment
Deployment
 
CDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptorCDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptor
 
Distributing information on iOS
Distributing information on iOSDistributing information on iOS
Distributing information on iOS
 
CDI @javaonehyderabad
CDI @javaonehyderabadCDI @javaonehyderabad
CDI @javaonehyderabad
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
 
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
 
Devoxx 2012 (v2)
Devoxx 2012 (v2)Devoxx 2012 (v2)
Devoxx 2012 (v2)
 
Rcp by example
Rcp by exampleRcp by example
Rcp by example
 
Architecting your GWT applications with GWT-Platform - Lesson 02
Architecting your GWT applications with GWT-Platform - Lesson 02Architecting your GWT applications with GWT-Platform - Lesson 02
Architecting your GWT applications with GWT-Platform - Lesson 02
 
Introduction to cdi given at java one 2014
Introduction to cdi given at java one 2014Introduction to cdi given at java one 2014
Introduction to cdi given at java one 2014
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
 
Dependency Injection and Pimple
Dependency Injection and PimpleDependency Injection and Pimple
Dependency Injection and Pimple
 

More from Bartosz Kosarzycki

Droidcon Summary 2021
Droidcon Summary 2021Droidcon Summary 2021
Droidcon Summary 2021
Bartosz Kosarzycki
 
Droidcon Online 2020 quick summary
Droidcon Online 2020 quick summaryDroidcon Online 2020 quick summary
Droidcon Online 2020 quick summary
Bartosz Kosarzycki
 
Animations in Flutter
Animations in FlutterAnimations in Flutter
Animations in Flutter
Bartosz Kosarzycki
 
Flutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessFlutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for business
Bartosz Kosarzycki
 
Flutter CI & Device Farms for Flutter
Flutter CI & Device Farms for FlutterFlutter CI & Device Farms for Flutter
Flutter CI & Device Farms for Flutter
Bartosz Kosarzycki
 
Drone racing - beginner's guide
Drone racing - beginner's guideDrone racing - beginner's guide
Drone racing - beginner's guide
Bartosz Kosarzycki
 
Optimize apps for Chromebooks - Meet.Intive Oct, 2018
Optimize apps for Chromebooks - Meet.Intive Oct, 2018Optimize apps for Chromebooks - Meet.Intive Oct, 2018
Optimize apps for Chromebooks - Meet.Intive Oct, 2018
Bartosz Kosarzycki
 
Android - Gradle build optimisation 3d83f31339d239abcc55f869e5f30348?s=47
Android - Gradle build optimisation  3d83f31339d239abcc55f869e5f30348?s=47Android - Gradle build optimisation  3d83f31339d239abcc55f869e5f30348?s=47
Android - Gradle build optimisation 3d83f31339d239abcc55f869e5f30348?s=47
Bartosz Kosarzycki
 
DroidCon Berlin 2018 summary
DroidCon Berlin 2018 summaryDroidCon Berlin 2018 summary
DroidCon Berlin 2018 summary
Bartosz Kosarzycki
 
SCALA - Functional domain
SCALA -  Functional domainSCALA -  Functional domain
SCALA - Functional domain
Bartosz Kosarzycki
 
Android things introduction - Development for IoT
Android things introduction - Development for IoTAndroid things introduction - Development for IoT
Android things introduction - Development for IoT
Bartosz Kosarzycki
 
Daggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processorDaggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processor
Bartosz Kosarzycki
 
Android antipatterns
Android antipatternsAndroid antipatterns
Android antipatterns
Bartosz Kosarzycki
 
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
Bartosz Kosarzycki
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requests
Bartosz Kosarzycki
 
ADG Poznań - Kotlin for Android developers
ADG Poznań - Kotlin for Android developersADG Poznań - Kotlin for Android developers
ADG Poznań - Kotlin for Android developers
Bartosz Kosarzycki
 
Kotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developersKotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developers
Bartosz Kosarzycki
 
Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projects
Bartosz Kosarzycki
 

More from Bartosz Kosarzycki (18)

Droidcon Summary 2021
Droidcon Summary 2021Droidcon Summary 2021
Droidcon Summary 2021
 
Droidcon Online 2020 quick summary
Droidcon Online 2020 quick summaryDroidcon Online 2020 quick summary
Droidcon Online 2020 quick summary
 
Animations in Flutter
Animations in FlutterAnimations in Flutter
Animations in Flutter
 
Flutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for businessFlutter overview - advantages & disadvantages for business
Flutter overview - advantages & disadvantages for business
 
Flutter CI & Device Farms for Flutter
Flutter CI & Device Farms for FlutterFlutter CI & Device Farms for Flutter
Flutter CI & Device Farms for Flutter
 
Drone racing - beginner's guide
Drone racing - beginner's guideDrone racing - beginner's guide
Drone racing - beginner's guide
 
Optimize apps for Chromebooks - Meet.Intive Oct, 2018
Optimize apps for Chromebooks - Meet.Intive Oct, 2018Optimize apps for Chromebooks - Meet.Intive Oct, 2018
Optimize apps for Chromebooks - Meet.Intive Oct, 2018
 
Android - Gradle build optimisation 3d83f31339d239abcc55f869e5f30348?s=47
Android - Gradle build optimisation  3d83f31339d239abcc55f869e5f30348?s=47Android - Gradle build optimisation  3d83f31339d239abcc55f869e5f30348?s=47
Android - Gradle build optimisation 3d83f31339d239abcc55f869e5f30348?s=47
 
DroidCon Berlin 2018 summary
DroidCon Berlin 2018 summaryDroidCon Berlin 2018 summary
DroidCon Berlin 2018 summary
 
SCALA - Functional domain
SCALA -  Functional domainSCALA -  Functional domain
SCALA - Functional domain
 
Android things introduction - Development for IoT
Android things introduction - Development for IoTAndroid things introduction - Development for IoT
Android things introduction - Development for IoT
 
Daggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processorDaggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processor
 
Android antipatterns
Android antipatternsAndroid antipatterns
Android antipatterns
 
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
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requests
 
ADG Poznań - Kotlin for Android developers
ADG Poznań - Kotlin for Android developersADG Poznań - Kotlin for Android developers
ADG Poznań - Kotlin for Android developers
 
Kotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developersKotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developers
 
Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projects
 

Recently uploaded

In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 

Recently uploaded (20)

In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 

Provider vs BLoC vs Redux

  • 5. Poznan Flutter Developer Group @override Widget build(BuildContext context) { return MultiProvider( providers: [ ChangeNotifierProvider(builder: (context) => UserLogin()), //hint: other providers go here ], child: Scaffold( appBar: AppBar( …. ) ) ); } class UserLogin with ChangeNotifier { String _user; …. } UserLogin userLogin = Provider.of<UserLogin>(context); userLogin.someAction(); userLogin.notifyListeners(); // usually inside another method
  • 8. Poznan Flutter Developer Group class UserSignInBloc { Sink<UserLogin> get login => _userCredentialsStream.sink; final _userCredentialsStream = BehaviorSubject<UserLogin>(); Stream<UserAuthenticationState> userSigned; UserSignInBloc() { userSigned = Observable.merge([ _userCredentialsStream.stream.switchMap(_signIn), // other login methods go here ]).asBroadcastStream(); } void dispose() { _userCredentialsStream.close(); } // Business logic here } _userSignInBloc.login.add(UserLogin(user, password));
  • 9. Poznan Flutter Developer Group var _userSignInBloc = UserSignInBloc(); ResultWidget(_userSignInBloc.userSigned), class ResultWidget extends StatefulWidget { Stream<UserAuthenticationState> userSigned; ResultWidget(this.userSigned); @override _ResultWidgetState createState() => _ResultWidgetState(userSigned); } class _ResultWidgetState extends State<ResultWidget> { var loginResultText = ""; _ResultWidgetState(Stream<UserAuthenticationState> userSigned){ userSigned.listen(onLoginDataChanged); } void onLoginDataChanged(UserAuthenticationState event) { if (event is UserAuthenticationLoading) { setState(() { loginResultText = "LOADING..."; }); } }
  • 15. Poznan Flutter Developer Group final store = Store<AppState>( appReducer, initialState: AppState.noLoggedUser(), middleware: createStoreLoginMiddleware(), ); @override Widget build(BuildContext context) { return StoreProvider( store: store, child: MaterialApp( … ) ); } UserLogin user = StoreProvider.of<AppState>(context).state.loggedUser; StoreProvider.of<AppState>(context).dispatch(LoginRequestAction(user, password)); class LoginUnsuccessfulAction {} TypedReducer<UserLogin, LoginSuccessfulAction>(_setUser) UserLogin _setUser(UserLogin user, LoginSuccessfulAction action) { print("Previous user: $user , storing new user: ${action.user}"); return action.user; }
  • 19. Poznan Flutter Developer Group https://github.com/kosiara/bloc-vs-pprov-vs-redux
  • 20. Poznan Flutter Developer Group Bartosz Kosarzycki Poznań Flutter Developer Group facebook.com/poznanflutter meetup.com/poznan-flutter-developers
  • 21. Poznan Flutter Developer Group https://redux.js.org/introduction/three-principles https://www.youtube.com/watch?v=Zbm3hjPjQMk https://www.udemy.com/course/react-redux/ https://medium.com/flutter-community/flutter-pragmatic-state- management-using-provider-5c1129f9b5bb https://pub.dev/packages/provider