Skip to content

Instantly share code, notes, and snippets.

@fabiancrx
Created February 7, 2020 15:26
Show Gist options
  • Save fabiancrx/6ef0374a9f5f43fe7b859d09301a7b33 to your computer and use it in GitHub Desktop.
Save fabiancrx/6ef0374a9f5f43fe7b859d09301a7b33 to your computer and use it in GitHub Desktop.
import 'dart:convert';
void main() {
String dataString = """[
{
"placeImage":"images/fish2.jpg",
"placeName":"Ikan 2",
"placeItem":["fish, crab, seafood"],
"minOrder":20
}
]""";
List<dynamic> dataJSON = jsonDecode(dataString);
dataJSON.forEach((object) {
String finalString="";
List<dynamic> dataList = object["placeItem"];
dataList.forEach((item) {
print(item);
finalString = finalString + item + " | ";
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment