I have a drawer in my main page that changes the body of the scaffold according to selected drawer item, now I need to change the body by tapping on a button in a fragment and call the setState() method of main class with a parameter to update the screen. How can I do this?
this is my Scaffold body:
body: _getDrawerItemWidget(_selectedDrawerIndex));
and when a drawer item is selected the setState() is called and body is filled according to this code :
_getDrawerItemWidget(int pos) {
switch (pos) {
case 0:
return new MainFragment();
case 1:
return new CardMgmt();
.........
}
}
but now I need to do this from a button in CardMgmt class.