Flutter Bloc Pattern and API Calling | Weather Application

  Рет қаралды 51,673

Easy Approach

Easy Approach

Күн бұрын

Пікірлер: 114
@codesnacksIO
@codesnacksIO 3 жыл бұрын
In the latest flutter_bloc updates you would find an error while creating WeatherBloc class since there have been a few changes. One, the initialState getter doesn't exist anymore. Two, the superclass Bloc MUST have a non-zero argument constructor. The argument passed is itself the initial state of the bloc. Code Fix - Remove the initialState getter. Add this line inside the bloc -- WeatherBloc() : super(WeatherIsNotSearched()); WeatherIsNotSearched being the initialState which earlier was declared using the initialState getter. Excellent tutorial, though. Well-planned and well-executed.
@fahadtahir6
@fahadtahir6 3 жыл бұрын
I have filtered out so many many tutorials for api calling with Bloc and I got to say this is amongest the best tutorial ever for learning Bloc as well as Api calling. Thank you Maaz. Huge effort.
@geoffrey9888
@geoffrey9888 3 жыл бұрын
I believe this is the best tutorial on bloc. Other tutorials dont explain it in a usable way they only explain the default increment and decrement. But in this video we can see a practical way of doing this. You've earned a new subscriber.
@ismaila2790
@ismaila2790 4 жыл бұрын
I watched 3videos with simple app examples but advanced way of laying out bloc which is not for someone trying to understand Bloc from scratch. Your video on the other hand was soo simple, and it was very helpful to just layout all the classes in one file to actually have the full picture. I think what you should do after this video is to restructure the classes in state, event and bloc folders. Thank you so mush ♥ 🙏
@EasyApproach
@EasyApproach 4 жыл бұрын
I am pleased :) please subscribe the channel.
@ismaila2790
@ismaila2790 4 жыл бұрын
@@EasyApproach Already a subscriber :)
@KamalVerma-wv1bg
@KamalVerma-wv1bg 2 жыл бұрын
Finally after watching alot of other video this video helped me to understand the whole concept
@alizajamal2798
@alizajamal2798 4 жыл бұрын
I'm amazed by the fact that you know so much, I keep wondering about the efforts it took for you to reach there. :) Hope to get more videos on state management approaches and their comparison. keep it up 🖐🏻
@EasyApproach
@EasyApproach 4 жыл бұрын
Thanks. Please watch all the other videos.
@jackryan1485
@jackryan1485 4 жыл бұрын
Hi bro I just watched your video and believe me i completely understand it and will surely implement it in my next production app, till now i didn't had an idea about how BLOC works but now i got it perfectly and will surely use it in next project. BTW i was using Providers till now in app, which is quite complex and it increases complexity in UI files. Thank your again.
@EasyApproach
@EasyApproach 4 жыл бұрын
Bro thanks :)
@marcothe_pineapple8905
@marcothe_pineapple8905 4 жыл бұрын
Thanks man so much easy to understand....bloc was different for me to understand since coming from iOS developer background..but u made it easy..also understood some other concepts of flutter since u explained everything in detail..thanks a lot.
@EasyApproach
@EasyApproach 4 жыл бұрын
Thanks. Please subscribe the channel for more :)
@mohammedhamdan1112
@mohammedhamdan1112 4 жыл бұрын
one of the most important tutorial . thanks a lot for showing a real life example !!
@EasyApproach
@EasyApproach 4 жыл бұрын
Glad it was helpful!
@badaruoluwasegun586
@badaruoluwasegun586 4 жыл бұрын
Wow...It's such an eye opener for me as to how BLOC Pattern works. And with this your simplicity in explanation, I feel much comfortable with BLOC Pattern. Thanks for this, really appreciate. Already a subscriber.
@EasyApproach
@EasyApproach 4 жыл бұрын
Glad it was helpful!
@EasyApproach
@EasyApproach 4 жыл бұрын
Thank you. Please subscribe the channel.
@Anullos42
@Anullos42 3 жыл бұрын
Very well, i dont understand a lot english but u write very simple. thank u!
@EasyApproach
@EasyApproach 3 жыл бұрын
You are welcome! Please subscribe the channel.
@Anullos42
@Anullos42 3 жыл бұрын
@@EasyApproach done
@grevity1943
@grevity1943 4 жыл бұрын
loved your explanation, honestly saying this is the best video on bloc i've ever found!
@gurkaransingh449
@gurkaransingh449 4 жыл бұрын
and this is my other account im subscribing from
@TreyHope
@TreyHope 4 жыл бұрын
Thank you very much for this explanation, very helpful.
@EasyApproach
@EasyApproach 4 жыл бұрын
Thank you so much please subscribe the channel
@irhas6555
@irhas6555 4 жыл бұрын
I working using flutter so I need to subscribe this channel
@EasyApproach
@EasyApproach 4 жыл бұрын
Thanks
@giaptt4037
@giaptt4037 4 жыл бұрын
thank you for this tutorial, It's very useful for newbie with bloc like me 😂
@amimulihsan5354
@amimulihsan5354 3 жыл бұрын
Well explained. Thank you. It was really understandable.
@EasyApproach
@EasyApproach 3 жыл бұрын
Thank you. Please subscribe the channel.
@oguzkuzu6179
@oguzkuzu6179 4 жыл бұрын
Loved it. Thank you! Please make more flutter tutorials in English
@EasyApproach
@EasyApproach 4 жыл бұрын
Thanks :) Please subscribe the channel for more videos
@typesoffun
@typesoffun 4 жыл бұрын
you are awesome bro..very good knowledge please upload more
@EasyApproach
@EasyApproach 4 жыл бұрын
Thank you, I will
@yasharma2301
@yasharma2301 4 жыл бұрын
You made Bloc pattern so easy, Subscribed!
@EasyApproach
@EasyApproach 4 жыл бұрын
Glad it helped :D
@vitalityofmind5864
@vitalityofmind5864 3 жыл бұрын
thank you sir, very helpful.
@EasyApproach
@EasyApproach 3 жыл бұрын
Thank you. Please subscribe the channel.
@kozimjonkholmirzaev4701
@kozimjonkholmirzaev4701 3 жыл бұрын
amazing usefull
@EasyApproach
@EasyApproach 3 жыл бұрын
Thank you. Please subscribe the channel.
@asadhameed1039
@asadhameed1039 4 жыл бұрын
Pure next level 🙌
@EasyApproach
@EasyApproach 4 жыл бұрын
Thank you. Please subscribe the channel.
@karthikm7063
@karthikm7063 4 жыл бұрын
what is the use of equatable ?. why use pass _city and weather in equatable. can you please explain ?
@karthikm7063
@karthikm7063 4 жыл бұрын
Thanks * 10000000 man , its 2 am i have been looking at different bloc tutorials. This is the one i understand most. i will try to connect api using bloc from office. Some doubts are there but still i think i can make it work. My last app(first app) was a mess it was full of set state + streambuilder , api calling inside ui programmed in the most stupid way possible (client will kill me if he see the code). i think my next app will be little bit better. Again thanks a lot man. Hope you reach 10k sub fast and get some money out of this. if there is any change in bloc for newer version please let me know !.
@EasyApproach
@EasyApproach 4 жыл бұрын
Thanks. Please subscribe the channel.
@IshaqueHassan
@IshaqueHassan 4 жыл бұрын
Really great one
@EasyApproach
@EasyApproach 4 жыл бұрын
Thanks 🔥
@samarfarag2375
@samarfarag2375 4 жыл бұрын
Great tutorial , thanks
@EasyApproach
@EasyApproach 4 жыл бұрын
Thanks for the appreciation :) Please subscribe the channel for more videos!
@sethysoumyaranjan
@sethysoumyaranjan 4 жыл бұрын
Very Nice and Clean Video!
@EasyApproach
@EasyApproach 4 жыл бұрын
Thank you :) Kindly subscribe the channel
@mrnicolaoda
@mrnicolaoda 4 жыл бұрын
Thanks for the tutorial! it is awesome and easy to understand. I will try to use your pattern to my next project of Flutter. But there is a question about it, how to implement more blocs in main.dart? Is there any of your videos explaining how to implement more than one bloc? Let me know. Thanks, mate!
@EasyApproach
@EasyApproach 4 жыл бұрын
Don't have yet!
@danku13
@danku13 4 жыл бұрын
hi! great video, can you comment what will be different with flutter_bloc ^6.0.2 instead of flutter_bloc ^2.0.0
@miftahuljihad4638
@miftahuljihad4638 4 жыл бұрын
Awesome Tutorial! I love it...
@EasyApproach
@EasyApproach 4 жыл бұрын
Thank you :)
@baselnat93
@baselnat93 4 жыл бұрын
Hi thanks alot for this great video i have two questions : 1- the usage of Equatable i understood the need of not "rebuild" the widget when the same state goes in but when you extend this Equatable and implement that props method how its working since you are not triggering anything here !! 2- what is the difference between BlocListeners and BlocBuilders what logic should be in each one of these? thanks alot in advance
@EasyApproach
@EasyApproach 4 жыл бұрын
The use of equatable is different check this for more detail : pub.dev/packages/equatable. BlocBuilder builds the UI on new state, however in BlocListener you listen to the new states to perform some operations like showing snackbar or navigating to the next screen... .
@baselnat93
@baselnat93 4 жыл бұрын
@@EasyApproach thanks alot for the quick response actually i checked the docs of equatable and i didnt find anything related to Bloc also in your video you mentioned that same thing i said and actually it make sense but i just couldnt understand how does it work kindly check at 15:33
@nerocastello8587
@nerocastello8587 4 жыл бұрын
Hi thankyou for this wonderful tutorial, my only concern is where do I put bloc.close() to close out the bloc?
@emmanuelezejiobi8908
@emmanuelezejiobi8908 Жыл бұрын
please anyone knows why i keep getting this error = Bad state: add(FetchWeather) was called without a registered event handler. Make sure to register a handler via on((event, emit) {...})
@fatihfajral
@fatihfajral 4 жыл бұрын
Good
@EasyApproach
@EasyApproach 4 жыл бұрын
Thanks
@enzuwu
@enzuwu 4 жыл бұрын
Great tutorial! I have a question though, in your video, you did not dispose of the bloc. I've read somewhere that it causes memory leaks if you don't dispose of it after a use case. So is that okay?
@EasyApproach
@EasyApproach 4 жыл бұрын
Yes it is important to dispose the bloc, may be I forgot!
@marcothe_pineapple8905
@marcothe_pineapple8905 4 жыл бұрын
I read it somewhere blocprovider does disposing of bloc on its own..dont need to do it manually.
@jose99Av
@jose99Av 4 жыл бұрын
great video, it was very helpful, I'am having a little of trouble when I'am doing the bloc with the constructor on WeatherBloc extends Bloc... while doing the constructor it said: "The superclass 'Bloc' doesn't have a zero argument constructor." please if someone now something I will be very greatful. already solved, it was cause the new version of bloc.
@oriogaming8142
@oriogaming8142 4 жыл бұрын
If we will again press the search button after loading the weather once then it should return home page - for this we need to do something like associate it with weathernotsearched state ? And by the way you didn't took use of initial state why ?
@krishnakumarramachandran5888
@krishnakumarramachandran5888 4 жыл бұрын
Thanks for this video brother, i have one doubt what is the use of Equatable ?
@EasyApproach
@EasyApproach 4 жыл бұрын
It helps in comparing the class instances. See pubdev and read documentation you will get the answer
@Golnarsheikhbahaie
@Golnarsheikhbahaie 4 жыл бұрын
thnx for video ;) .... guys is there any video for http post request in bloc pattern ?????
@awlad
@awlad 2 жыл бұрын
Good tutorial on bloc, I have a question say you want to update your block state (refresh api call) based on a firestore stream value how would you do it? Thanks
@EasyApproach
@EasyApproach 2 жыл бұрын
Listen to the stream and on new data just add a new state updateState.
@awlad
@awlad 2 жыл бұрын
@@EasyApproach Thanks are you able to provide code sample? Thanks
@subaruhassufferredenough7892
@subaruhassufferredenough7892 4 жыл бұрын
Thanks for this amazing tutorial. Just one thing, what if I am using navigation routes to implement the search result as a separate page? How can I use BloC pattern in that case?
@EasyApproach
@EasyApproach 4 жыл бұрын
If I am not wrong you are asking about how to navigate to other screen when we have some new particular state. If yes, then in BLoC, there is a something called BlocListener and inside it you can navigate to other screen on getting new state
@subaruhassufferredenough7892
@subaruhassufferredenough7892 4 жыл бұрын
@@EasyApproach Thanks so much. That is exactly what I was asking about.
@EasyApproach
@EasyApproach 4 жыл бұрын
I am glad. Please subscribe the channel! :)
@subaruhassufferredenough7892
@subaruhassufferredenough7892 4 жыл бұрын
@@EasyApproach done.. Keep up with the excellent content.
@EasyApproach
@EasyApproach 4 жыл бұрын
@@subaruhassufferredenough7892 Thank you so much! I appreciate.
@krishkapadia5704
@krishkapadia5704 2 жыл бұрын
can we done all the things without creating model class? like react js or react-native
@shivamagrawal6991
@shivamagrawal6991 2 жыл бұрын
I can't understand how to use if one screen in multiple event
@umidjonshoniyozov162
@umidjonshoniyozov162 4 жыл бұрын
Thanks bro
@EasyApproach
@EasyApproach 4 жыл бұрын
Please subscribe the channel for more such videos!
@azeemushanali98
@azeemushanali98 4 жыл бұрын
Brother I have One query please solve it,if possible.I am trying to print some of my http response.body in a Text widget.I have strored that response.body part in a variable and when I pass that variable it throws an error and app crashes down.It says - " Flutter is not a subtype of String".Please help me.!!
@heyoung548
@heyoung548 4 жыл бұрын
Could you add streambuilder into this BLoc pattern?
@EasyApproach
@EasyApproach 4 жыл бұрын
Sure in Future video!
@rizwanulhaquerizvi265
@rizwanulhaquerizvi265 3 жыл бұрын
Can anyone help me? What does get props do?
@saeed577
@saeed577 4 жыл бұрын
not bad
@EasyApproach
@EasyApproach 4 жыл бұрын
Thanks
@i-am-learning-life
@i-am-learning-life 4 жыл бұрын
please use vs code i love that editor it is clear to see there
@EasyApproach
@EasyApproach 4 жыл бұрын
Ok sure! I would definitely do! Thanks for the suggestion. Please subscribe the channel to get more videos! :)
@vkumarnegi
@vkumarnegi 4 жыл бұрын
@@EasyApproach Use the IDE you're comfortable with. Don't let the tools affect your teaching style just because someone is not comfortable. They'll get along if you teach well.
@EasyApproach
@EasyApproach 4 жыл бұрын
@@vkumarnegi :)
@AwesomeShamik
@AwesomeShamik 4 жыл бұрын
Wouldnt it makes sense, in the long run, to use Android Studio as an IDE for Flutter since both are from the same company Google
@kxaif
@kxaif 4 жыл бұрын
Can i know how to learn flutter to advance,how did you learnt flutter
@EasyApproach
@EasyApproach 4 жыл бұрын
Just try different things in Flutter, and if you find any issue try to find the solution and the reason why did you get this error, by doing this, gradually, you will be pro ;)
@leniloud2072
@leniloud2072 3 жыл бұрын
What if I want to get the pressure and humidity how can I do that
@EasyApproach
@EasyApproach 3 жыл бұрын
It is already we are getting from api
@russazsuraj630
@russazsuraj630 3 жыл бұрын
I don't know what is the reason but mine shows Error in the initial state :(
@tumhokon5598
@tumhokon5598 3 жыл бұрын
Hii suraj i am also working on wheather app, can we chat on telegram ?
@kawtarkawtar9848
@kawtarkawtar9848 4 жыл бұрын
will the API of this site be free even if I put the application on play stor? or i will pay
@EasyApproach
@EasyApproach 4 жыл бұрын
It's free.
@kawtarkawtar9848
@kawtarkawtar9848 4 жыл бұрын
@@EasyApproach thank u so much
@faheemahmad3957
@faheemahmad3957 Жыл бұрын
pleas remake for flutter 3.13
@terlumunjoseph6779
@terlumunjoseph6779 4 жыл бұрын
your view is too small increase zoom level
@EasyApproach
@EasyApproach 4 жыл бұрын
Sorry for the this. In latest videos screen is zoomed
@bedbyaspokhrel
@bedbyaspokhrel 4 жыл бұрын
Why your subs is too low?
@EasyApproach
@EasyApproach 4 жыл бұрын
Do you think it should be more than that :D?
@EasyApproach
@EasyApproach 4 жыл бұрын
actually i am new
@bedbyaspokhrel
@bedbyaspokhrel 4 жыл бұрын
Yes your video list is too long and great
@EasyApproach
@EasyApproach 4 жыл бұрын
@@bedbyaspokhrel Thanks for the appreciation :)
Flutter Interactive Login UI using Flare 2d
14:52
Easy Approach
Рет қаралды 14 М.
Flutter Bloc State Management With API Calling (Dictionary App)
1:04:39
Incredible Dog Rescues Kittens from Bus - Inspiring Story #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 36 МЛН
WILL IT BURST?
00:31
Natan por Aí
Рет қаралды 43 МЛН
Fake watermelon by Secret Vlog
00:16
Secret Vlog
Рет қаралды 10 МЛН
Easiest way to understand BLOC Pattern in Flutter
15:52
Easy Approach
Рет қаралды 96 М.
KMP vs. Flutter - Who Will Win The Cross-Platform Battle?
16:19
Philipp Lackner
Рет қаралды 46 М.
GetX Powerful Framework in Flutter in Detail (2021)
40:16
Easy Approach
Рет қаралды 88 М.
Bloc Library: Basics & Beyond - Felix Angelov | Flutter Europe
46:16
Flutter Europe
Рет қаралды 58 М.
Bloc Library - Painless State Management for Flutter
24:54
Reso Coder
Рет қаралды 92 М.
GetX State Management In Flutter With API Calling (Flutter Tutorial)
1:22:56
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 1,1 МЛН
Incredible Dog Rescues Kittens from Bus - Inspiring Story #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 36 МЛН