Closed AscentionOne closed 3 years ago
I would suggest to use a state management solution like e.g. riverpod or getx
@AscentionOne I'd suggest the same as @benjaminschreck, I'd have a categories state somewhere up my widgets tree and have my categoryRoute/page read it's state from there based on categoryId.
I'm thinking of something that looks like this
class CategoriesController/Cubit{
final categoriesState = <int,SingleCategoryState>{}
loadCategoryStateOf(int catId){
// check if state already exists in map, if not load it.
}
}
t
Thanks, @benjaminschreck @Milad-Akarie I'll give it a try and see how it goes!
Hi, @Milad-Akarie I am building a web application with a list of tabs. You can refer to https://unsplash.com/. There are feature tabs on the navigation section. When clicking each feature it will navigate to the page and also preserve the state when navigating between features(data don't need to be load every time when the user navigates between them).
Is there a good way to implement this kind of tab? I have around 15 categories and each has its own data. I am currently creating a page route that takes 15 different category types as id
/category/:id
.How do I preserve the data between categories like using
AutoTabsRouter
. I am currently using the same generic page, thus constantly updating the page. The state will not be preserved. Thanks!