pile_nav_new/lib/controllers/appcontroller.dart
2024-11-15 17:42:52 +08:00

25 lines
532 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();
final mapcontroller = Get.find<ScenceMapController>();
// 绑定 currentIndex
ever(currentIndex, (value) {
mapcontroller.currentIndex.value = value;
currentIndex.value = value;
});
// ever(mapcontroller.currentIndex, (value) {
// });
}
}