toJson static method

MapEntry<String, dynamic> toJson(
  1. StorageEntryTypeV11 entry
)

Creates Map from Class Object

Implementation

static MapEntry<String, dynamic> toJson(StorageEntryTypeV11 entry) {
  switch (entry.kind) {
    case 'Plain':
      return MapEntry('Plain', (entry as StorageEntryTypeV11_Plain).value);
    case 'Map':
      return MapEntry('Map', (entry as StorageEntryTypeV11_Map).toJson());
    case 'DoubleMap':
      return MapEntry(
          'DoubleMap', (entry as StorageEntryTypeV11_DoubleMap).toJson());
    default:
      throw UnexpectedTypeException('Unexpected type: ${entry.kind}');
  }
}