pagination work

This commit is contained in:
Christien Rioux 2024-06-03 21:20:00 -04:00
parent 4082d1dd76
commit 5473bd2ee4
11 changed files with 469 additions and 24 deletions

18
lib/tools/misc.dart Normal file
View file

@ -0,0 +1,18 @@
extension StringExt on String {
(String, String?) splitOnce(Pattern p) {
final pos = indexOf(p);
if (pos == -1) {
return (this, null);
}
final rest = substring(pos);
var offset = 0;
while (true) {
final match = p.matchAsPrefix(rest, offset);
if (match == null) {
break;
}
offset = match.end;
}
return (substring(0, pos), rest.substring(offset));
}
}