convex_bottom_bar icon indicating copy to clipboard operation
convex_bottom_bar copied to clipboard

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

Open Wadie-ess opened this issue 4 years ago • 1 comments

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<Widget> 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,

  ),
);

}

Wadie-ess avatar Apr 23 '21 15:04 Wadie-ess

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

avenwu avatar Apr 24 '21 07:04 avenwu