getPriority method

int? getPriority(
  1. Object obj
)

Optionally override this to expose a numeric "priority" classification.

This method provides a hook for subclasses to implement custom priority resolution logic. By default, it returns null indicating that standard ordering should be used.

Parameters:

  • obj: The object to determine priority for

Returns:

The priority value, or null if not applicable

Usage in Subclasses:

class CustomOrderComparator extends OrderComparator {
  @override
  int? getPriority(Object obj) {
    if (obj is MyComponent) {
      return obj.getCustomPriority();
    }
    return super.getPriority(obj);
  }
}

Implementation

int? getPriority(Object obj) => null;