EnumField<T> constructor

EnumField<T>({
  1. String? columnName,
  2. bool? notNull,
  3. bool? isUnique,
  4. String? jsonMapName,
  5. required Map<int, T> valuesMap,
})

Create an instance of EnumField

Implementation

EnumField(
    {String? columnName,
    bool? notNull,
    bool? isUnique,
    String? jsonMapName,
    required Map<int, T> valuesMap})
    : assert(valuesMap.keys.isNotEmpty, 'Map must have entries'),
      super(
        columnName,
        notNull: notNull,
        isUnique: isUnique,
        jsonMapName: jsonMapName,
        jsonMapType: int,
      ) {
  _valuesMap = _BiMap<int, T>()..addAll(valuesMap);
}