fromJson static method

PalletMetadataV14 fromJson(
  1. Map<String, dynamic> map
)

Creates Class Object from Json

Implementation

static PalletMetadataV14 fromJson(Map<String, dynamic> map) {
  final obj = PalletMetadataV14(
      name: map['name'],
      index: map['index'],
      constants: (map['constants'] as List)
          .map((value) => PalletConstantMetadataV14.fromJson(value))
          .toList(growable: false));

  if (map['storage'] != null &&
      map['storage'] is Option &&
      (map['storage'] as Option).value != null) {
    obj.storage = PalletStorageMetadataV14.fromJson(map['storage'].value);
  }

  if (map['calls'] != null &&
      map['calls'] is Option &&
      (map['calls'] as Option).value != null) {
    obj.calls = PalletCallMetadataV14.fromJson(map['calls'].value);
  }

  if (map['events'] != null &&
      map['events'] is Option &&
      (map['events'] as Option).value != null) {
    obj.events = PalletEventMetadataV14.fromJson(map['events'].value);
  }

  if (map['errors'] != null &&
      map['errors'] is Option &&
      (map['errors'] as Option).value != null) {
    obj.errors = PalletErrorMetadataV14.fromJson(map['errors'].value);
  }

  return obj;
}