Answers for "how to fetch data from json file in flutter"

0

how to fetch data from json file in flutter

import 'dart:convert';

main() {
  String jsonS = """{
    "stream": {
        "tv": [{
            "name": "Tv",
            "description": "Tv",
            "url": "this is the url",
            "image": "imagelink"

        }]
    }
}""";
  var myMap = json.decode(jsonS);
  var myName = myMap['stream']['tv'][0]['name'];
  print('${myName}');
}
Posted by: Guest on July-04-2021

Code answers related to "how to fetch data from json file in flutter"

Browse Popular Code Answers by Language