Files
eatvio_app/lib/features/insights/models/insights_period.dart
2026-11-10 12:41:21 +03:00

47 lines
1.2 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:eatvio_app/generated/l10n.dart';
/// Период для вкладок «Вес», «ИМТ» и «Замеры». Значение совпадает с `{period}` в
/// `/api/profile/measure/weight/{period}`.
enum BodyPeriod {
month('1'),
threeMonths('3'),
sixMonths('6'),
year('12'),
all('all');
const BodyPeriod(this.apiValue);
final String apiValue;
/// Подпись пилюли периода.
String pillLabel(S s) => switch (this) {
month => s.insights_period_1m,
threeMonths => s.insights_period_3m,
sixMonths => s.insights_period_6m,
year => s.insights_period_1y,
all => s.insights_period_all,
};
}
/// Период для вкладки «КБЖУ по дням». Значение совпадает с `daily_period` в `/api/profile/insights`.
enum DailyPeriod {
week('7'),
twoWeeks('14'),
month('30'),
threeMonths('90'),
all('all');
const DailyPeriod(this.apiValue);
final String apiValue;
/// Подпись пилюли периода.
String pillLabel(S s) => switch (this) {
week => s.insights_period_1w,
twoWeeks => s.insights_period_2w,
month => s.insights_period_1m,
threeMonths => s.insights_period_3m,
all => s.insights_period_all,
};
}