forked from eatvio/eatvio_app
feat(insights): first isights impemetation
This commit is contained in:
18
lib/features/insights/presentation/cubit/insights_panel.dart
Normal file
18
lib/features/insights/presentation/cubit/insights_panel.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
/// Вкладки блока «Аналитика».
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user