When using the Flutter Scaffold.Drawer - is it possible to have the links in the Drawer change the content (Scaffold.body) on the page?
Similarly to having links in
That's a very good solution from Aziza! Thank you. It works! I'd just want to add that it can also work for the whole body by replacing it with a widget state:
...
class _TestPageState extends State {
String text = "Initial Text";
Widget widgetForBody = SomeWidgetFromClass();
...
...
children: [
new Container(child: new DrawerHeader(child: new Container())),
new Container (
child: new Column(
children: [
new ListTile(leading: new Icon(Icons.info),
onTap:(){
setState((){
widgetForBody = AnotherWidgetFromClass();
});
}
),
new ListTile(leading: new Icon(Icons.save),
onTap:(){
setState((){
widgetForBody = YetAnotherWidgetFromClass();
});
}
),
...