defaultValue property

dynamic defaultValue
final

The default value of this field for class hive types.

This value takes precedence over constructor parameter default values.

In enum hive types set true to use this enum value as default value instead of null in null-safety.

@HiveType(typeId: 1)
enum MyEnum {
  @HiveField(0)
  apple,

  @HiveField(1, defaultValue: true)
  pear
}

Implementation

final dynamic defaultValue;