1/16/2024 0 Comments Flutter provider global state![]() ![]() To be specific i have two filters a) Category b) Sub category. Now i want to add a filter to it, i.e to be able to filter data. In the previous blog we saw that we were able to display a list of data. Let’s see where we are currently in terms of state management in our flutter app with an example. State management is basically to optimize this cycle for apps, make it consistent, scalable and easy to use. ![]() So there are two main entities in any app.Īny change in data should trigger an ui update, and ui will update data which will again trigger UI update. There should be a consistent way of doing this so that we can also keep track of app state and easily debug if something goes wrong. We need to be able to define a global state, we need to be able to communicate state changes between widgets so then can react accordingly. Let’s say we have an app with different widgets/component or elements. Let’s first try to understand what we are trying to solve. A database contain’s entire collection of data, while app state only has data to display the current ui for the app. Don’t not confuse this with database or data stored in a db. ![]() So app state is basically all data/information we need to display the current state of app. App state is also the data which is needed in an app to display UI e.g logged in user information, maybe a list we display from our api response or any such data. App state can be of different types like UI state (e.g showing a loading indicator, value of a dropdown, value of text field, to show/hide a element, etc). In short data used by the app is called state. App Stateįor any application we develop there is always data involved. In this blog post, we will look more deeply into state manage in flutter apps. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |