Hierarchy.fromJson constructor

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

Implementation

factory Hierarchy.fromJson(Map<String, Object?> json) {
  return Hierarchy(
    baseLevelId: (json[r'baseLevelId'] as num?)?.toInt(),
    levels: (json[r'levels'] as List<Object?>?)
            ?.map((i) => SimplifiedHierarchyLevel.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
  );
}