| 1234567891011121314151617181920212223242526272829303132333435 |
- import 'package:application/service/map_watch.dart';
- import 'package:get/get.dart';
- import '../home_controller.dart';
- export 'package:application/service/map_watch.dart';
- class FieldControlController extends GetxController {
- @override
- void onInit() {
- super.onInit();
- final map = MapWatchService.instance;
- if (map != null) {
- activeList.bindStream(map.activeList.stream);
- }
- }
- HomeController get _home => Get.find();
- MapWatchService? get mapWatch => MapWatchService.instance;
- final activeList = <ActiveInfo>[].obs;
- // final Rx<UserInfo?> focusUser = Rx(null);
- final Rx<int?> focusUserId = Rx(null);
- UserInfo? get focusUser{
- if(focusUserId.value== null){
- return null;
- }
- for(final act in activeList){
- for(final user in act.userList){
- if(user.id == focusUserId.value){
- return user;
- }
- }
- }
- return null;
- }
- }
|