updated designe of aboute diet page

This commit is contained in:
Username1548
2024-11-11 21:10:38 +07:00
parent a9b28c27b9
commit c5e1c5d9b8
46 changed files with 2164 additions and 1012 deletions

View File

@@ -0,0 +1,43 @@
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
import 'package:eatvio_app/generated/l10n.dart';
String getLocalizedMeasurementUnits(S s, Portion portion) {
switch (portion) {
case Portion.GRAMS:
return s.gr;
case Portion.MILLILITERS:
return s.milliliter;
case Portion.PCS:
return s.pcs;
}
}
String getDayForm(int number, S s) {
if (number % 100 >= 11 && number % 100 <= 14) {
return s.days;
}
int lastDigit = number % 10;
if (lastDigit == 1) {
return s.day.toLowerCase();
} else if (lastDigit >= 2 && lastDigit <= 4) {
return s.another_form_of_day;
} else {
return s.days;
}
}
String getCommentForm(int number, S s) {
if (number % 100 >= 11 && number % 100 <= 14) {
return s.comments_plural;
}
int lastDigit = number % 10;
if (lastDigit == 1) {
return s.comment;
} else if (lastDigit >= 2 && lastDigit <= 4) {
return s.another_form_of_comment;
} else {
return s.comments_plural;
}
}