Answers for "read json file flutter and convert to model"

5

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);
}
Posted by: Guest on October-16-2020
4

flutter convert json string to json

flutter convert json string to json
----------------------
var x1 = '[{"id": "1"}]';
List<dynamic> x2 = jsonDecode(x1);
print(x2[0]);
Posted by: Guest on May-13-2021

Code answers related to "read json file flutter and convert to model"

Code answers related to "Javascript"

Browse Popular Code Answers by Language