Тёмный

Flutter Bloc Pattern and API Calling | Weather Application 

Easy Approach
Подписаться 26 тыс.
Просмотров 52 тыс.
50% 1

In this video, I have developed Flutter Weather Application using BLOC pattern as statement. Furthermore, the application is calling the API as well from "openweathermap.org/"
API Link : api.openweathermap.org/data/2...{city name}&APPID=43ea6baaad7663dc17637e22ee6f78f2
Flare Actor : www.2dimensions.com/a/Arkange...
GitHub : github.com/themaaz32/WeatherA...

Наука

Опубликовано:

 

5 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 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.
@geoffrey9888
@geoffrey9888 2 года назад
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.
@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.
@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.
@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!
@grevity1943
@grevity1943 3 года назад
loved your explanation, honestly saying this is the best video on bloc i've ever found!
@gurkaransingh449
@gurkaransingh449 3 года назад
and this is my other account im subscribing from
@KamalVerma-wv1bg
@KamalVerma-wv1bg 2 года назад
Finally after watching alot of other video this video helped me to understand the whole concept
@yasharma2301
@yasharma2301 4 года назад
You made Bloc pattern so easy, Subscribed!
@EasyApproach
@EasyApproach 4 года назад
Glad it helped :D
@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 :)
@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.
@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 :)
@TreyHope
@TreyHope 4 года назад
Thank you very much for this explanation, very helpful.
@EasyApproach
@EasyApproach 4 года назад
Thank you so much 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
@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 :)
@amimulihsan5354
@amimulihsan5354 3 года назад
Well explained. Thank you. It was really understandable.
@EasyApproach
@EasyApproach 3 года назад
Thank you. Please subscribe the channel.
@asadhameed1039
@asadhameed1039 4 года назад
Pure next level 🙌
@EasyApproach
@EasyApproach 4 года назад
Thank you. Please subscribe the channel.
@vitalityofmind5864
@vitalityofmind5864 3 года назад
thank you sir, very helpful.
@EasyApproach
@EasyApproach 3 года назад
Thank you. Please subscribe the channel.
@IshaqueHassan
@IshaqueHassan 4 года назад
Really great one
@EasyApproach
@EasyApproach 4 года назад
Thanks 🔥
@sethysoumyaranjan
@sethysoumyaranjan 4 года назад
Very Nice and Clean Video!
@EasyApproach
@EasyApproach 4 года назад
Thank you :) Kindly subscribe the channel
@miftahuljihad4638
@miftahuljihad4638 4 года назад
Awesome Tutorial! I love it...
@EasyApproach
@EasyApproach 4 года назад
Thank you :)
@samarfarag2375
@samarfarag2375 4 года назад
Great tutorial , thanks
@EasyApproach
@EasyApproach 4 года назад
Thanks for the appreciation :) Please subscribe the channel for more videos!
@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
@giaptt4037
@giaptt4037 3 года назад
thank you for this tutorial, It's very useful for newbie with bloc like me 😂
@typesoffun
@typesoffun 4 года назад
you are awesome bro..very good knowledge please upload more
@EasyApproach
@EasyApproach 4 года назад
Thank you, I will
@kozimjonkholmirzaev4701
@kozimjonkholmirzaev4701 3 года назад
amazing usefull
@EasyApproach
@EasyApproach 3 года назад
Thank you. Please subscribe the channel.
@irhas6555
@irhas6555 4 года назад
I working using flutter so I need to subscribe this channel
@EasyApproach
@EasyApproach 4 года назад
Thanks
@nerocastello8587
@nerocastello8587 4 года назад
Hi thankyou for this wonderful tutorial, my only concern is where do I put bloc.close() to close out the bloc?
@umidjonshoniyozov162
@umidjonshoniyozov162 4 года назад
Thanks bro
@EasyApproach
@EasyApproach 4 года назад
Please subscribe the channel for more such videos!
@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.
@fatihfajral
@fatihfajral 4 года назад
Good
@EasyApproach
@EasyApproach 4 года назад
Thanks
@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!
@oriogaming8142
@oriogaming8142 3 года назад
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 ?
@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) {...})
@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.
@danku13
@danku13 3 года назад
hi! great video, can you comment what will be different with flutter_bloc ^6.0.2 instead of flutter_bloc ^2.0.0
@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.!!
@krishkapadia5704
@krishkapadia5704 2 года назад
can we done all the things without creating model class? like react js or react-native
@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.
@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
@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
@rizwanulhaquerizvi265
@rizwanulhaquerizvi265 3 года назад
Can anyone help me? What does get props do?
@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.
@heyoung548
@heyoung548 4 года назад
Could you add streambuilder into this BLoc pattern?
@EasyApproach
@EasyApproach 4 года назад
Sure in Future video!
@shivamagrawal6991
@shivamagrawal6991 2 года назад
I can't understand how to use if one screen in multiple event
@Golnarsheikhbahaie
@Golnarsheikhbahaie 4 года назад
thnx for video ;) .... guys is there any video for http post request in bloc pattern ?????
@saeed577
@saeed577 4 года назад
not bad
@EasyApproach
@EasyApproach 4 года назад
Thanks
@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
@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
@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 ;)
@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 ?
@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
@faheemahmad3957
@faheemahmad3957 11 месяцев назад
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
Просмотров 14 тыс.
Easiest way to understand BLOC Pattern in Flutter
15:52
Bloc Library - Painless State Management for Flutter
24:54
Why The Windows Phone Failed
24:08
Просмотров 228 тыс.
GetX Powerful Framework in Flutter in Detail (2021)
40:16
Flutter Pagination Rest API List View (Infinite List)
34:38
Проверил, как вам?
0:58
Просмотров 345 тыс.