简体   繁体   中英

How to update the Existing File (Path_Provider) in Flutter

I have a question about path_provider package, i'm fetching the api data and once i received the data i cache the json data in File . How can i update the existing file, Because whenever i got any changes or updates in api data then it doesn't make any update or refresh on cache file data. Is there any articles or documents or videos to show how to update the existing file?

You can just add

File(path).deleteSync(recursive: true);

to delete the existing file then recreate it as it's a new.

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