toJson method

Map<String, Object?> toJson()

Converts this step into a serialization-friendly map.

Implementation

Map<String, Object?> toJson() {
  return <String, Object?>{
    'index': index,
    'action': action.name,
    if (text != null) 'text': text,
    if (keyType != null) 'keyType': keyType!.name,
    if (x != null) 'x': x,
    if (y != null) 'y': y,
    if (endX != null) 'endX': endX,
    if (endY != null) 'endY': endY,
    if (width != null) 'width': width,
    if (height != null) 'height': height,
    if (dragSteps != null) 'dragSteps': dragSteps,
  };
}