#1 - Why BLoC? | BLoC - from Zero to Hero

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what is going on everyone and let me wish you a huge warm welcome to the first tutorial of this series on flutterly i'm wicked and today i'll be guiding you throughout an introduction on block explaining why i chose block as my favorite state management library and design pattern going through the main aspects of it and hopefully at the end of the video you'll have yourself some good reference on why it's an amazing idea to start a news block on every project from now on so without further ado let's get right into it but first of all let me ask you a question have you ever installed an application which started to crash for no reason while using it an app perhaps that after you clicked a button in order to load some data freeze for 3-4 seconds without displaying absolutely any message into the ui or maybe an app which only works with internet connection but goes haywire if there's no one available i'm assuming that at least for some of you the answer will be definitely yes then you'll know how frustrating it is for an user to not receive a visual representation for any interaction with the application the main problem here is that the code is not clear organized maintainable nor testable developers of these apps are thinking about what works for the moment instead of reflecting what would work in maintaining the app in the long run the main idea in programming is that you and your team need to write code using an architecture which fits you the best an architecture which can accommodate every feature and scale over time now let me give you a quick story in my first weeks of learning flutter and dark from some tutorials online i wanted to give it a try and build my own first app by myself but eventually after a couple of days of coding i was struck by the feeling that i cannot maintain the code anymore due to the fact that all of it was spread throughout the app randomly so there was the moment when i learned the most important lesson i have started to look for a way to organize and structure the ideas and features in my code in order to build an application that will be maintainable and scalable over time in flutter the best way to keep your code organized clean and maintainable is to have a component which can mediate what the user sees often referred as ui front-end or presentation and the logic behind it this component i'm referring to is as you may have already guessed block which is an abbreviation for business logic component generally speaking block is a design pattern created by google to help separate business logic from the presentation layer and enable developers to reuse code more easily there is a state management library created and maintained by felix angelo called block which helps developers implement the block design pattern in their flutter applications what does this mean actually well as developers it's really necessary to know what the state of our app is at any time remember when i said that for every interaction with the app there should be something displayed on the screen to let the user know what's going on technically for every interaction the application should be in a different state for example when the data is fetching the app should be in a loading state displaying a loading animation on the screen when the internet is off the application should display a pop-up to let the user know that there is no internet connection this is good app design thinking of every possible case and having a state emerging from it so not only does the block library separate presentation from business logic it also simplifies the way we manage the state of the application so after all by learning block and using the block library you'll have the following huge advantages which will lead you and your team to be better developers block will allow you to have a better understanding of what's happening inside your own app thus making it more organized structured and easier to test and maintain there won't be a moment in which you won't know what the state of your app is because of the way block is built for every user interaction there will be an emerging state making the wall state management issue simple to overcome and all within a single stable and powerful block code base following its patterns and conventions in the next video from the series we'll learn about the core concepts in more detail introducing events states transitions streams blocks qubits and many many more until then i hope that this tutorial on y block was of great help for you and i'm looking forward to seeing you in the next episode until next time take care wicked is out bye bye
Info
Channel: Flutterly
Views: 17,065
Rating: undefined out of 5
Keywords: BLOC, bloc, flutter, google, whybloc, tutorial, programming, dart, state management, library, design pattern, mobile
Id: _7Mh66FFSNg
Channel Id: undefined
Length: 5min 24sec (324 seconds)
Published: Fri Aug 28 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.