getOrder abstract method

int getOrder()

A contract for objects that are assigned an order or precedence value.

This is typically used for sorting or prioritization where lower values have higher priority (i.e., 0 is higher than 10).

Framework components such as filters, interceptors, and plugins can implement Ordered to control execution sequence.


🧭 Ordering Rules


📌 Example

class MyFilter implements Ordered {
  @override
  int get order => 10;
}

final filters = [MyFilter(), AnotherFilter()];
filters.sort((a, b) => a.order.compareTo(b.order));

Implementation

int getOrder();