Térkép refraktorálás

This commit is contained in:
2026-05-17 00:35:21 +02:00
parent d50a324e44
commit ee0f90e247
5 changed files with 499 additions and 98 deletions
@@ -4,6 +4,7 @@ class ShellController extends GetxController {
static ShellController get to => Get.find();
final currentIndex = 0.obs;
final isNavBarVisible = true.obs;
static const titles = [
'Térkép',
@@ -24,4 +25,8 @@ class ShellController extends GetxController {
void goToSurvey() => goToTab(1);
void goToTracking() => goToTab(2);
void goToData() => goToTab(3);
void showNavBar() => isNavBarVisible.value = true;
void hideNavBar() => isNavBarVisible.value = false;
void toggleNavBar() => isNavBarVisible.value = !isNavBarVisible.value;
}
@@ -46,30 +46,37 @@ class ShellView extends GetView<ShellController> {
index: controller.currentIndex.value,
children: _pages,
)),
bottomNavigationBar: Obx(() => NavigationBar(
selectedIndex: controller.currentIndex.value,
onDestinationSelected: controller.goToTab,
destinations: const [
NavigationDestination(
icon: Icon(Icons.map_outlined),
selectedIcon: Icon(Icons.map),
label: 'Térkép',
),
NavigationDestination(
icon: Icon(Icons.gps_fixed),
label: 'Mérés',
),
NavigationDestination(
icon: Icon(Icons.route),
label: 'Track',
),
NavigationDestination(
icon: Icon(Icons.table_chart_outlined),
selectedIcon: Icon(Icons.table_chart),
label: 'Adatok',
),
],
)),
bottomNavigationBar: Obx(
() => AnimatedSize(
duration: const Duration(milliseconds: 250),
curve: Curves.easeInOut,
child: controller.isNavBarVisible.value
? NavigationBar(
selectedIndex: controller.currentIndex.value,
onDestinationSelected: controller.goToTab,
destinations: const [
NavigationDestination(
icon: Icon(Icons.map_outlined),
selectedIcon: Icon(Icons.map),
label: 'Térkép',
),
NavigationDestination(
icon: Icon(Icons.gps_fixed),
label: 'Mérés',
),
NavigationDestination(
icon: Icon(Icons.route),
label: 'Track',
),
NavigationDestination(
icon: Icon(Icons.table_chart_outlined),
selectedIcon: Icon(Icons.table_chart),
label: 'Adatok',
),
],
)
: const SizedBox.shrink()),
),
);
}
}