Enum adaptera Regiter Hive

Hive.registerAdapter(MediaTypesAdapter()); // <- register the adapter where you have the others registred

// mediaData.dart <- file
import 'package:hive/hive.dart';
part 'mediaData.g.dart';

@HiveType(typeId: 22)
enum MediaTypes {
  @HiveField(0)
  Photo,
  @HiveField(1)
  Video,
}
loonix