Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

didn't get latest data when moving from screen to screen #143

Open
Wadie-ess opened this issue Apr 23, 2021 · 1 comment
Open

didn't get latest data when moving from screen to screen #143

Wadie-ess opened this issue Apr 23, 2021 · 1 comment

Comments

@Wadie-ess
Copy link

i have list of items in the HomeScreen a button to make each of them as favorite
and FavoriteScreen to Get the favorite Items but
when i mark item as favorite in the home screen i didn't gei it when moving to the favoritescreen using bottombar but when i use PushNamed i get it
please help !!
my code
int cindex = 1;
void addIndex(int index) {
setState(() {
cindex = index;
});
}
List tabs = [FavoriteScreen(),HomeScreen(),DoneScreen(),ProfileScreen() ];

@OverRide
Widget build(BuildContext context) {

var myHeight = MediaQuery.of(context).size.height;
return Scaffold(
  bottomNavigationBar: ConvexAppBar(
    height: myHeight * 0.071,
    elevation: 10,
  
    

    backgroundColor: Color(0Xff0c9556),
 
    items: [
      TabItem(icon: Icons.favorite, title: 'Favorite'),
      TabItem(icon: Icons.home, title: 'Home'),
      TabItem(icon: Icons.done_all, title: 'Done !'),
      TabItem(icon: Icons.person, title: 'Profile'),
    ],
    initialActiveIndex: 1, //optional, default as 0
    onTap: (int i) => addIndex(i),
  ),
  
  body: IndexedStack(
    children: tabs,
    index: cindex,

  ),
);

}

@avenwu
Copy link
Contributor

avenwu commented Apr 24, 2021

what do you expect? I didn't see the data you've mentioned. is it the index?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants