ComparatorRule constructor
const
ComparatorRule(
- OrderComparator comparator
A property source ordering rule that sorts sources using a custom OrderComparator.
This rule allows flexible, user-defined sorting logic for PropertySource instances. The comparator defines how two sources are compared and determines their relative order.
Example
final comparator = MyCustomComparator();
final rule = ComparatorRule(comparator);
final reordered = rule.apply(sourcesList);
The reordered list will be sorted according to the logic implemented in comparator.
Implementation
const ComparatorRule(this.comparator);