You need to use the dispose() method of State or the default constructor of ChangeNotifierProvider . The latter automatically disposes of the object created in the create function.
You need to use the dispose() method of State or the default constructor of ChangeNotifierProvider . The latter automatically disposes of the object created in the create function.