Dashboard.fromJson constructor

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

Implementation

factory Dashboard.fromJson(Map<String, Object?> json) {
  return Dashboard(
    automaticRefreshMs: (json[r'automaticRefreshMs'] as num?)?.toInt(),
    description: json[r'description'] as String?,
    editPermissions: (json[r'editPermissions'] as List<Object?>?)
            ?.map((i) => SharePermission.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    id: json[r'id'] as String?,
    isFavourite: json[r'isFavourite'] as bool? ?? false,
    isWritable: json[r'isWritable'] as bool? ?? false,
    name: json[r'name'] as String?,
    owner: json[r'owner'] != null
        ? UserBean.fromJson(json[r'owner']! as Map<String, Object?>)
        : null,
    popularity: (json[r'popularity'] as num?)?.toInt(),
    rank: (json[r'rank'] as num?)?.toInt(),
    self: json[r'self'] as String?,
    sharePermissions: (json[r'sharePermissions'] as List<Object?>?)
            ?.map((i) => SharePermission.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    systemDashboard: json[r'systemDashboard'] as bool? ?? false,
    view: json[r'view'] as String?,
  );
}