compare method
Compare two P
properties returned by the mapper.
Implementation
@override
int compare(P a, P b) {
final aIndex = _findGroupIndex(a);
if (aIndex == -1) {
throw StateError(
'Cannot sort value "$a". Add it to the orderGroups list first.',
);
}
final bIndex = _findGroupIndex(b);
if (bIndex == -1) {
throw StateError(
'Cannot sort value "$b". Add it to the orderGroups list first.',
);
}
return aIndex.compareTo(bIndex);
}