fromJson static method

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

Returns a new DocumentPatch instance and imports its values from json if it's non-null, null if json is null.

Implementation

static DocumentPatch? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return DocumentPatch(
    body: json[r'body'] == null
        ? null
        : List<Map<String, dynamic>>.from(json[r'body']),
    file: DocumentPatchFile.fromJson(json[r'file']),
    permission: DocumentPatchPermission.fromJson(json[r'permission']),
    text: json[r'text'],
    tags: json[r'tags'] == null ? null : List<String>.from(json[r'tags']),
  );
}