Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

hive regiter adapter enum

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,
}
 
PREVIOUS NEXT
Tagged: #hive #regiter #adapter #enum
ADD COMMENT
Topic
Name
2+9 =