fromVersion static method

Metadata fromVersion(
  1. Map<String, dynamic> json,
  2. int version
)

Creates Metadata Object from the version info

Implementation

static Metadata fromVersion(Map<String, dynamic> json, int version) {
  switch (version) {
    case 9:
      return Metadata_V9.fromJson(json);
    case 10:
      return Metadata_V10.fromJson(json);
    case 11:
      return Metadata_V11.fromJson(json);
    case 12:
      return Metadata_V12.fromJson(json);
    case 13:
      return Metadata_V13.fromJson(json);
    case 14:
      return Metadata_V14.fromJson(json);
    default:
      throw Exception('Unknown Metadata version: $version');
  }
}