registerHiveTypeAdapter<T> method

void registerHiveTypeAdapter<T>(
  1. TypeAdapter<T> typeAdapter
)

add Object Type to registry for parsing and, treating cache as HiveType

Implementation

void registerHiveTypeAdapter<T>(TypeAdapter<T> typeAdapter) {
  if (!Hive.isAdapterRegistered(typeAdapter.typeId)) {
    Hive.registerAdapter(typeAdapter);
    this._registry[T] = CacheTypeResolver<T>(
        type: CacheType.HiveType,
        cacheDataToType: (dynamic data) => (data as T));
  }
}