asMap property

Map<String, dynamic> get asMap

Map representation of this object

Implementation

Map<String, dynamic> get asMap {
  Map<String, dynamic> _map = {
    "key": key,
    "label": label,
    "icon": icon == null ? null : icon!.codePoint,
    "expanded": expanded,
    "parent": parent,
    "children": children.map((Node child) => child.asMap).toList(),
  };
  if (data != null) {
    _map['data'] = data;
  }
  //TODO: figure out a means to check for getter or method on generic to include map from generic
  return _map;
}