2026-05-11 13:50:40 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
import 'package:terepi_seged/pages/home/presentation/views/home_view.dart';
|
2026-05-12 00:14:11 +02:00
|
|
|
import 'package:terepi_seged/pages/map_survey/presentations/controllers/map_survey_controller.dart';
|
|
|
|
|
import 'package:terepi_seged/widgets/gnss_status_chip.dart';
|
2026-05-11 13:50:40 +02:00
|
|
|
|
|
|
|
|
import '../../../../widgets/app_drawer.dart';
|
2026-05-12 00:14:11 +02:00
|
|
|
import '../../../map_survey/presentations/views/map_survey_view.dart';
|
2026-05-11 13:50:40 +02:00
|
|
|
import '../controllers/shell_controller.dart';
|
|
|
|
|
|
|
|
|
|
class ShellView extends GetView<ShellController> {
|
|
|
|
|
const ShellView({super.key});
|
|
|
|
|
|
|
|
|
|
static const _pages = [
|
|
|
|
|
HomeView(),
|
|
|
|
|
//MapView(),
|
|
|
|
|
MapSurveyView(),
|
|
|
|
|
//TrackingView(),
|
|
|
|
|
//DataView(),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: AppBar(
|
|
|
|
|
// Cím reaktívan frissül tab váltáskor
|
|
|
|
|
title: Obx(() => Text(controller.currentTitle)),
|
|
|
|
|
actions: [
|
2026-05-12 00:14:11 +02:00
|
|
|
const GnssStatusChip(),
|
|
|
|
|
const SizedBox(width: 6),
|
|
|
|
|
Obx(() => controller.currentIndex.value == 1
|
|
|
|
|
? NtripStatusChip(
|
|
|
|
|
isConnected: MapSurveyController.to.ntripIsConnected,
|
|
|
|
|
onToggle: () {
|
|
|
|
|
final c = MapSurveyController.to;
|
|
|
|
|
c.ntripIsConnected.value
|
|
|
|
|
? c.disconnectFromNtripServer()
|
|
|
|
|
: c.connectToNtripServer();
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox.shrink())
|
2026-05-11 13:50:40 +02:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
drawer: const AppDrawer(),
|
|
|
|
|
body: Obx(() => IndexedStack(
|
|
|
|
|
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',
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|