Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

example of list of maps in flutter

var locations = {
    {
      'country': 'Egypt',
      'city': 'Cairo',
      'Latitude': 30.033333,
      'Longitude': 31.233334,
      'utcOffset': 2
    },
    {
      'country': 'Thailand',
      'city': 'Bangkok',
      'Latitude': 13.7563,
      'Longitude': 100.5018,
      'utcOffset': 7
    },
  };

  for (var element in locations) {
    print(element["country"]);
  }

  // or

  locations.forEach((element) => print(element["country"]));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #list #maps #flutter
ADD COMMENT
Topic
Name
7+3 =