MobilApp/lib/pages/shell/presentations/controllers/shell_controller.dart

33 lines
832 B
Dart
Raw Normal View History

import 'package:get/get.dart';
class ShellController extends GetxController {
static ShellController get to => Get.find();
final currentIndex = 0.obs;
2026-05-17 00:35:21 +02:00
final isNavBarVisible = true.obs;
static const titles = [
'Térkép',
'Pontmérés',
'Nyomvonal',
'Adatok',
];
String get currentTitle => titles[currentIndex.value];
void goToTab(int index) {
if (index < 0 || index >= titles.length) return;
currentIndex.value = index;
}
// Shortcutok — a Drawerből hívhatók
void goToMap() => goToTab(0);
void goToSurvey() => goToTab(1);
void goToTracking() => goToTab(2);
void goToData() => goToTab(3);
2026-05-17 00:35:21 +02:00
void showNavBar() => isNavBarVisible.value = true;
void hideNavBar() => isNavBarVisible.value = false;
void toggleNavBar() => isNavBarVisible.value = !isNavBarVisible.value;
}