Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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}');
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #fetch #data #json #file #flutter
ADD COMMENT
Topic
Name
3+4 =