When back to BlueSettings page, initState show null on "Current value:"
When use stand alone BlueSettings whithout any MaterialPageRoute, it works
I want to use with MaterialPageRoute, what I do I miss?
Thanks for your help
here is my code:
main.dart
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Application'),
),
drawer: const DrawerMenu(),
);
}
}
drawer_menu.dart
class DrawerMenu extends StatelessWidget {
const DrawerMenu({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Drawer(
child: ListView(
// Important: Remove any padding from the ListView.
padding: EdgeInsets.zero,
children: <Widget>[
ListTile(
title: const Text("Blue settings"),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const BlueSettings(),
),
);
},
),
],
),
);
}
}