toJson method
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,
};
}