OrderSourceProvider class abstract
A strategy interface for providing an alternative source of order metadata for a given object.
This is useful when sorting or prioritizing objects based on external metadata rather than relying solely on their own Ordered or PriorityOrdered interface.
For example, an object may not directly implement Ordered, but its order may be derived from another associated object (its “order source”).
⚙️ How It Works:
- The provided getOrderSource method may return:
📌 Example
class PodOrderSourceProvider extends OrderSourceProvider {
final Map<Object, Object> _orderSources;
PodOrderSourceProvider(this._orderSources);
@override
Object? getOrderSource(Object obj) => _orderSources[obj];
}
This allows indirect ordering via metadata while keeping the target class clean.
Constructors
- OrderSourceProvider()
-
A strategy interface for providing an alternative source of order metadata
for a given object.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getOrderSource(
Object obj) → Object? - A strategy interface for providing an alternative source of order metadata for a given object.
-
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