SpaceCreate.fromJson constructor

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

Implementation

factory SpaceCreate.fromJson(Map<String, Object?> json) {
  return SpaceCreate(
    key: json[r'key'] as String? ?? '',
    name: json[r'name'] as String? ?? '',
    description: json[r'description'] != null
        ? SpaceDescriptionCreate.fromJson(
            json[r'description']! as Map<String, Object?>)
        : null,
    permissions: (json[r'permissions'] as List<Object?>?)
            ?.map((i) => SpacePermissionCreate.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
  );
}