forked from eatvio/eatvio_app
19 lines
586 B
Dart
19 lines
586 B
Dart
/// Вкладки блока «Аналитика».
|
||
enum InsightsPanel {
|
||
weight,
|
||
bmi,
|
||
measures,
|
||
daily,
|
||
intra;
|
||
|
||
/// Вкладки КБЖУ доступны только при включённом флаге.
|
||
bool get isKbju => this == daily || this == intra;
|
||
|
||
/// Кнопка «+» есть только у вкладок с ручным вводом.
|
||
bool get supportsAdd => this == weight || this == measures;
|
||
|
||
static List<InsightsPanel> available({required bool kbjuEnabled}) {
|
||
return values.where((panel) => kbjuEnabled || !panel.isKbju).toList();
|
||
}
|
||
}
|