How to add data to an existing json file in assets folder in flutter based on input given by user?
How to add data to an existing json file in assets folder in flutter based on input given by user?
Create a model as your JSON and add the fromJson toJson method. Call the model class and pass your new data init. Read this documation: https://docs.flutter.dev/development/data-and-backend/json
You cannot do this. Assets are read-only. Read this for options on how to persist data between app runs: https://docs.flutter.dev/cookbook/persistence