Skip to content

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

Open
@Wadie-ess

Description

@Wadie-ess

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,

  ),
);

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions