toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  return <String, Object?>{
    'type': type,
    if (repeat != 1) 'repeat': repeat,
    if (ms != 0) 'ms': ms,
    if (value.isNotEmpty) 'value': value,
    if (key.isNotEmpty) 'key': key,
    if (direction != 'down') 'direction': direction,
    if (x != 0) 'x': x,
    if (y != 0) 'y': y,
    if (x2 != 0) 'x2': x2,
    if (y2 != 0) 'y2': y2,
    if (steps != 8) 'steps': steps,
    if (eventType.isNotEmpty) 'eventType': eventType,
    if (eventFields.isNotEmpty) 'eventFields': eventFields,
  };
}