forked from eatvio/eatvio_app
47 lines
1.2 KiB
Dart
47 lines
1.2 KiB
Dart
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,
|
||
};
|
||
}
|