I am trying to drop elements from JSON. Here is my code:
String test = '[{
"type":"new",
"color":"red",
"items": ["aa","bb", "cc"]
}]';
var myJson = jsonDecode(test);
var result = myJson.where((a)=> a != 'items');
print(result);
It does not work. I need to drop items
and get:
[{"type":"new","color":"red"}]