flutter import json packeg code example
Example 1: read json file flutter
Future<String>_loadFromAsset() async {
return await rootBundle.loadString("assets/quiz.json");
}
Future parseJson() async {
String jsonString = await _loadFromAsset();
final jsonResponse = jsonDecode(jsonString);
}
Example 2: flutter generate json files
flutter packages pub run build_runner build