Skip to content

Instantly share code, notes, and snippets.

@iapicca
Created October 7, 2019 10:09
Show Gist options
  • Save iapicca/7b94427c4e5922b13d2649603628e6d3 to your computer and use it in GitHub Desktop.
Save iapicca/7b94427c4e5922b13d2649603628e6d3 to your computer and use it in GitHub Desktop.
Json Decode
import 'dart:convert';
const String _object_key = 'object';
const String _subset_key = 'subset';
const String _json = '{"object": [{"subset":"hello"},{"subset":" "},{"subset":"world"}]}';
void main() => print(jsonDecode(_json)[_object_key].map((d)=> d[_subset_key] as String).join());
@iapicca
Copy link
Author

iapicca commented Oct 7, 2019

simple example of decoding a json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment