GnssService osztály és refraktorálás a app_drawer miatt, shellview bevezetés.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ShellController extends GetxController {
|
||||
static ShellController get to => Get.find();
|
||||
|
||||
final currentIndex = 0.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);
|
||||
}
|
||||
Reference in New Issue
Block a user