ReplayAction.fromJson constructor

ReplayAction.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ReplayAction.fromJson(Map<String, dynamic> json) {
  return ReplayAction(
    type: (json['type'] as String? ?? '').trim(),
    repeat: (json['repeat'] as int?) ?? 1,
    ms: (json['ms'] as int?) ?? 0,
    value: (json['value'] as String?) ?? '',
    key: (json['key'] as String?) ?? '',
    direction: (json['direction'] as String?) ?? 'down',
    x: (json['x'] as int?) ?? 0,
    y: (json['y'] as int?) ?? 0,
    x2: (json['x2'] as int?) ?? (json['x'] as int?) ?? 0,
    y2: (json['y2'] as int?) ?? (json['y'] as int?) ?? 0,
    steps: (json['steps'] as int?) ?? 8,
    eventType: (json['eventType'] as String? ?? '').trim(),
    eventFields: _asJsonObject(json['eventFields']),
  );
}