2026-05-11 13:50:40 +02:00
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
|
|
class ShellController extends GetxController {
|
|
|
|
|
static ShellController get to => Get.find();
|
|
|
|
|
|
2026-05-27 15:04:46 +02:00
|
|
|
final currentIndex = 1.obs;
|
2026-05-17 00:35:21 +02:00
|
|
|
final isNavBarVisible = true.obs;
|
2026-05-11 13:50:40 +02:00
|
|
|
|
|
|
|
|
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;
|
2026-05-11 13:50:40 +02:00
|
|
|
}
|