toJsonMap method

  1. @override
Map<String, Object> toJsonMap ()
override

Serialize the node excluding its descendants to a JSON map.

Subclasses should override if they have additional properties that are useful for the GUI tools that consume this JSON.

See also:

  • WidgetInspectorService, which forms the bridge between JSON returned by this method and interactive tree views in the Flutter IntelliJ plugin.

Implementation

@override
Map<String, Object> toJsonMap() {
  final Map<String, Object> json = super.toJsonMap();
  if (value != null) {
    json['values'] = value.map<String>((T value) => value.toString()).toList();
  }
  return json;
}