UserOrganisationUnit.fromJson constructor

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

Implementation

factory UserOrganisationUnit.fromJson(Map<String, dynamic> json) {
  return UserOrganisationUnit(
      id: json['id'],
      name: json['id'],
      orgUnit: json['orgUnit'] ?? json['id'],
      parent: json['parent'] != null && json['parent'].runtimeType == List
          ? json['parent']['id']
          : json['parent'].runtimeType == String
              ? json['parent']
              : null,
      user: json['user'],
      type: json['type'],
      dirty: json['dirty'].runtimeType == "String"
          ? json["dirty"] == "true"
              ? true
              : false
          : json['dirty'] ?? false);
}