Initial and done prolly

This commit is contained in:
Andrew 2025-01-05 16:01:21 +07:00
commit 6f88b9966f
175 changed files with 15445 additions and 0 deletions

View file

@ -0,0 +1,24 @@
extension PluralizeIntExtension on int {
String pluralize({
required String name,
required String absent,
required String absentMul,
}) {
final plurality = this % 10 == 1 && this % 100 != 11
? 0
: this % 10 >= 2 &&
this % 10 <= 4 &&
(this % 100 < 10 || this % 100 >= 20)
? 1
: 2;
switch (plurality) {
case 1:
return "$this $absent";
case 2:
return "$this $absentMul";
default:
return "$this $name";
}
}
}