toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    'name': name,
    'initialState': initialState.isNotEmpty
        ? initialState
        : states.entries.firstOrNull?.key,
    'states': states,
    'workflows': workflows,
    'currentState': currentState,
    'stateHistory': stateHistory,
  };
}