pile_nav_new/lib/controllers/appcontroller.dart
tanlinxing 0006b0eefe 抽屉
2024-09-03 18:05:49 +08:00

24 lines
566 B
Dart

import 'package:get/get.dart';
import 'package:scence_map/controllers/controller.dart';
class AppController extends GetxController {
final RxBool isDarkMode = false.obs;
var currentIndex = 0.obs;
@override
void onInit() {
super.onInit();
// 获取 AnotherController 的实例
final mapcontroller = Get.find<ScenceMapController>();
// 绑定 currentIndex
ever(currentIndex, (value) {
mapcontroller.currentIndex.value = value;
});
ever(mapcontroller.currentIndex, (value) {
currentIndex.value = value;
});
}
}