Persist Provider data across multiple pages not working
You have 2 options:
Place your
ChangeNotifierProvider
above yourMaterialApp
so that is accesible from any of youNavigator
routes.Keep your
Home
widget as is but when pushing the new widget with theNavigator
provide the original Manager.
onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) { return Provider<ToDoListManager>.value( value: toDoListManager, child: Details(index), ); }, ), );},
With both approaches you don't need to create a new ChangeNotifierProvider
in your details screen.