toJson method

Map<String, Object?> toJson()

Encodes this value as a JSON object.

Implementation

Map<String, Object?> toJson() => <String, Object?>{
  'nodeId': nodeId,
  'generation': generation,
  'parentNodeId': parentNodeId == null ? null : parentNodeId!,
  'depth': depth,
  'identifier': identifier,
  'label': label,
  if (value != null) 'value': value!,
  if (valueRedacted != null) 'valueRedacted': valueRedacted!,
  if (hint != null) 'hint': hint!,
  if (tooltip != null) 'tooltip': tooltip!,
  'flags': flags.map((item) => item).toList(growable: false),
  'actions': actions.map((item) => item).toList(growable: false),
  'invisible': invisible,
  'userActionsBlocked': userActionsBlocked,
  'rect': rect.toJson(),
  'rectCoordinateSpace': rectCoordinateSpace,
  if (transformToParent != null)
    'transformToParent': transformToParent!
        .map((item) => item)
        .toList(growable: false),
  if (scrollPosition != null) 'scrollPosition': scrollPosition!,
  if (scrollExtentMin != null) 'scrollExtentMin': scrollExtentMin!,
  if (scrollExtentMax != null) 'scrollExtentMax': scrollExtentMax!,
  if (platformViewId != null) 'platformViewId': platformViewId!,
  'children': children.map((item) => item).toList(growable: false),
};