How to read local json import in flutter?
You should look into loading assets in flutter. You can’t simply import an arbitrary file. Importing is for source code/libraries. You need to declare this file as an asset in your pubspec.yaml flutter: assets: – json_data.json Then in your code you can load this asset as a String: import ‘package:flutter/services.dart’ show rootBundle; Future<String> getJson() { … Read more