fromJson static method
Returns a new Workflow instance and imports its values from
json
if it's non-null, null if json
is null.
Implementation
static Workflow? fromJson(Map<String, dynamic>? json) {
if (json == null) {
return null;
}
DateTime? createdAt =
json[r'createdAt'] == null ? null : DateTime.parse(json[r'createdAt']);
if (createdAt != null && createdAt.isUtc == false) {
createdAt = DateTime.parse('${json[r'createdAt']}Z');
}
DateTime? updatedAt =
json[r'updatedAt'] == null ? null : DateTime.parse(json[r'updatedAt']);
if (updatedAt != null && updatedAt.isUtc == false) {
updatedAt = DateTime.parse('${json[r'updatedAt']}Z');
}
return Workflow(
links: WorkflowLinks.fromJson(json[r'_links']),
createdAt: createdAt,
description: json[r'description'],
end: WorkflowState.fromJson(json[r'end']),
id: json[r'id'],
name: json[r'name'],
start: WorkflowState.fromJson(json[r'start']),
states: WorkflowState.listFromJson(json[r'states']),
transitions: WorkflowTransition.listFromJson(json[r'transitions']),
type: json[r'type'],
updatedAt: updatedAt,
);
}