Search code examples
jsondebuggingflutterassets

Changes in JSON file arent used in app - Flutter


When I make changes to my JSON File and I reinstall the app on my Android device it is using a previous version of the JSON File sometimes.

Deinstall the app and clear all the data didnt resolve the issue. Packages get & update in pubspec.yaml didnt help either.

Im loading the data with a FutureBuilder with

future: DefaultAssetBundle.of(context).loadString("assets/EN.json")

as part of loading the json File.

expected: change the dummydata from the jsonfile from dummyTitle7 to July and on next run of the app to see the title July

actual: still having dummyTitle7 as the title althoug the jsonfile has changed


Solution

  • Ensure that your pubspec.yaml file reflects the change in assets and run

    flutter packages get
    

    After you update any of your assets