loadJSON method
- String json = '[]',
Loads this controller with data from a JSON String This method expects the user to properly update the state
setState((){
controller = controller.loadJSON(json: jsonString);
});
Implementation
TreeViewController loadJSON({String json = '[]'}) {
List jsonList = jsonDecode(json);
List<Map<String, dynamic>> list = List<Map<String, dynamic>>.from(jsonList);
return loadMap(list: list);
}