简体   繁体   中英

Flutter: How to reset provider view model data?

Is there any way to reset all view model data (ChangeNotifier)? Tried to dispose the view model but didn't work. I want to clear all data when user logout.

Does this help you? Basically adding an ObjectKey to your Provider which you change when the user logs out or whatever.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM