EntityField class

Configuration of a entity field.

  • hidden: this field won't be stored if is hidden.
  • unique: this filed should be unique in the repository/table.
  • minimum: defines the minimum value or minimum size of the field.
  • maximum: defines the maximum value or maximum size of the field.
  • regexp: defines the RegExp pattern of the field.
  • validator: defines a validation Function for the field.
Inheritance
Annotations
  • @Target({TargetKind.field, TargetKind.getter})

Constructors

EntityField({bool hidden = false, bool unique = false, bool indexed = false, num? minimum, num? maximum, bool validator(Object? value)?, String? regexp})
const
EntityField.hidden()
const
EntityField.indexed()
const
EntityField.limits(int minimum, int maximum)
const
EntityField.maximum(int maximum)
const
EntityField.minimum(int minimum)
const
EntityField.regexp(String regexp)
const
EntityField.unique()
const
EntityField.validator(bool validator(Object? value))
const
EntityField.visible()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isHidden bool
Returns true if the annotated field should be hidden from storage.
no setter
isIndexed bool
Returns true if the annotated field should be indexed.
no setter
isUnique bool
Returns true if the annotated field should be unique.
no setter
isVisible bool
Returns true if the annotated field should be visible to storage.
no setter
maximum num?
final
minimum num?
final
regexp String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
validator → (bool Function(Object? value)?)
final

Methods

isValidValue(Object? value, {String? fieldName}) bool
Returns true if value is valid for this EntityField configuration.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validateValue(Object? value, {String? fieldName, Type? entityType}) EntityFieldInvalid?
Returns a EntityFieldInvalid if value is invalid for this EntityField configuration.

Operators

operator ==(Object other) bool
The equality operator.
inherited