OrderBy class

The OrderBy class is used to create OData $orderby expressions, allowing sorting by fields in either ascending or descending order.

Example:

final orderBy = OrderBy.desc('Price');
print(orderBy.toString());
Output: "Price desc"

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Converts the order-by clause to a string for query usage.
override

Operators

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

Static Methods

asc(String field) OrderBy
Sorts results by a field in ascending order (e.g., "Price asc").
desc(String field) OrderBy
Sorts results by a field in descending order (e.g., "Price desc").