How to Create , Edit and store data in root bundle files in flutter

Viewed 31

I need is to "edit" a json file that is on my assets folder. To read a file from assets I can use this:

Future<String> setFileData(String path) async { return await rootBundle.loadString(path); }

But No Found any Method to write data in the same file The problem is that i need to call data from api request and store it to working directory like as assets or lib folder in flutter project. All The Answer and methods that i found it store data on the mobile device and i don't need that

Screenshot

1 Answers

The assets directory is read-only. You need to write your files somewhere on the device, see for example: Read and write files

Related