Answers for "hive enum flutter"

1

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,
}
Posted by: Guest on September-14-2020

Code answers related to "Dart"

Browse Popular Code Answers by Language