24 lines
566 B
Dart
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;
|
|
});
|
|
}
|
|
}
|