FilterableField class

Annotation to mark a field as filterable with specific configuration.

This annotation defines how a field can be filtered and sorted.

Parameters:

  • label: The display label for the field in UI.
  • comparatorsType: The type used for comparison operations.
  • comparators: Optional list of allowed comparators. If null, defaults are used.
  • customCompare: Optional custom comparison function.
  • isNullable: Whether the field is nullable (auto-detected if not provided).

Example:

@FilterableField(
  label: 'Price',
  comparatorsType: double,
  comparators: ['==', '!=', '>', '<', '>=', '<='],
)
final double price;

Constructors

FilterableField({required String label, required Type comparatorsType, List<String>? comparators, Function? customCompare, bool? isNullable})
Creates a FilterableField annotation.
const

Properties

comparators List<String>?
Optional list of allowed comparators. If null, default comparators for the type will be used.
final
comparatorsType Type
The type used for value comparison.
final
customCompare Function?
Optional custom comparison function.
final
hashCode int
The hash code for this object.
no setterinherited
isNullable bool
Whether this field can be null.
final
label String
The display label for this field.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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