subFromJson function

RemoteSub subFromJson(
  1. Map<String, dynamic> json
)

Implementation

RemoteSub subFromJson(Map<String, dynamic> json) {
  if (json['sub'] == null) throw FormatException();
  return RemoteSub(
      json['name'],
      json['sub'].map<RemoteLab>((element) {
        try {
          return subFromJson(formatMap(element.toString()));
        } on FormatException {
          return libsFromJson(formatMap(element.toString()));
        } catch (e) {
          throw FormatYamlException;
        }
      }).toList());
}