Új appbar, NtripSettingsSheet

This commit is contained in:
2026-05-27 15:04:46 +02:00
parent ce8b539be3
commit 3d4c937b71
13 changed files with 789 additions and 67 deletions
@@ -3,7 +3,7 @@ import 'package:get/get.dart';
class ShellController extends GetxController {
static ShellController get to => Get.find();
final currentIndex = 0.obs;
final currentIndex = 1.obs;
final isNavBarVisible = true.obs;
static const titles = [
@@ -4,6 +4,8 @@ import 'package:terepi_seged/pages/home/presentation/views/home_view.dart';
import 'package:terepi_seged/pages/map_survey/presentations/controllers/map_survey_controller.dart';
import 'package:terepi_seged/services/ntrip_service.dart';
import 'package:terepi_seged/widgets/gnss_status_chip.dart';
import 'package:terepi_seged/widgets/shell_adaptive_appbar.dart';
import 'package:terepi_seged/widgets/shell_map_appbar.dart';
import '../../../../widgets/app_drawer.dart';
import '../../../map_survey/presentations/views/map_survey_view.dart';
@@ -22,63 +24,36 @@ class ShellView extends GetView<ShellController> {
@override
Widget build(BuildContext context) {
final mapController = Get.find<MapSurveyController>();
return Scaffold(
extendBody: true,
extendBodyBehindAppBar: false,
appBar: AppBar(
// Cím reaktívan frissül tab váltáskor
title: Obx(() => Text(controller.currentTitle)),
actions: [
const GnssStatusChip(),
const SizedBox(width: 6),
Obx(() => controller.currentIndex.value == 1
? NtripStatusChip(
isConnected: NtripService.to.isConnected,
onToggle: () {
NtripService.to.isConnected.value
? NtripService.to.disconnect()
: NtripService.to.connect();
},
)
: const SizedBox.shrink())
],
),
// extendBody: true,
// extendBodyBehindAppBar: false,
resizeToAvoidBottomInset: true,
appBar: ShellMapAppBar(controller: mapController),
// appBar: AppBar(
// // Cím reaktívan frissül tab váltáskor
// title: Obx(() => Text(controller.currentTitle)),
// actions: [
// const GnssStatusChip(),
// const SizedBox(width: 6),
// Obx(() => controller.currentIndex.value == 1
// ? NtripStatusChip(
// isConnected: NtripService.to.isConnected,
// onToggle: () {
// NtripService.to.isConnected.value
// ? NtripService.to.disconnect()
// : NtripService.to.connect();
// },
// )
// : const SizedBox.shrink())
// ],
// ),
drawer: const AppDrawer(),
body: Obx(() => IndexedStack(
index: controller.currentIndex.value,
children: _pages,
)),
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()),
),
);
}
}