Board.fromJson constructor

Board.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory Board.fromJson(Map<String, Object?> json) {
  return Board(
    id: (json[r'id'] as num?)?.toInt(),
    self: json[r'self'] as String?,
    name: json[r'name'] as String?,
    type: json[r'type'] as String?,
    admins: json[r'admins'] as Map<String, Object?>?,
    location: json[r'location'] != null
        ? BoardLocation.fromJson(json[r'location']! as Map<String, Object?>)
        : null,
    canEdit: json[r'canEdit'] as bool? ?? false,
    isPrivate: json[r'isPrivate'] as bool? ?? false,
    favourite: json[r'favourite'] as bool? ?? false,
  );
}