dirSortFunc function
Implementation
@visibleForTesting
int dirSortFunc(String a, String b) {
var aCnt = '/'.allMatches(a).length;
var bCnt = '/'.allMatches(b).length;
if (aCnt != bCnt) {
if (aCnt < bCnt) return -1;
if (aCnt > bCnt) return 1;
}
if (a.isEmpty && b.isEmpty) return 0;
if (a.isEmpty) {
return -1;
}
if (b.isEmpty) {
return 1;
}
return a.compareTo(b);
}