pile_nav_new/lib/controllers/appcontroller.dart

24 lines
566 B
Dart
Raw Normal View History

2024-08-30 17:57:33 +08:00
import 'package:get/get.dart';
2024-09-03 18:05:49 +08:00
import 'package:scence_map/controllers/controller.dart';
2024-08-30 17:57:33 +08:00
class AppController extends GetxController {
final RxBool isDarkMode = false.obs;
2024-09-03 18:05:49 +08:00
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;
});
}
2024-08-30 17:57:33 +08:00
}