周睿 2 years ago
parent
commit
e9c1576e30

+ 44 - 0
ios/Podfile

@@ -0,0 +1,44 @@
+# Uncomment this line to define a global platform for your project
+# platform :ios, '11.0'
+
+# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
+ENV['COCOAPODS_DISABLE_STATS'] = 'true'
+
+project 'Runner', {
+  'Debug' => :debug,
+  'Profile' => :release,
+  'Release' => :release,
+}
+
+def flutter_root
+  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
+  unless File.exist?(generated_xcode_build_settings_path)
+    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
+  end
+
+  File.foreach(generated_xcode_build_settings_path) do |line|
+    matches = line.match(/FLUTTER_ROOT\=(.*)/)
+    return matches[1].strip if matches
+  end
+  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
+end
+
+require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
+
+flutter_ios_podfile_setup
+
+target 'Runner' do
+  use_frameworks!
+  use_modular_headers!
+
+  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
+  target 'RunnerTests' do
+    inherit! :search_paths
+  end
+end
+
+post_install do |installer|
+  installer.pods_project.targets.each do |target|
+    flutter_additional_ios_build_settings(target)
+  end
+end

+ 1 - 1
lib/view/home/data_detail/data_detail.dart

@@ -277,7 +277,7 @@ class _UserListView extends GetView<DataDetailController> {
     return Container(
       margin: const EdgeInsets.only(left: 12, top: 2, bottom: 4),
       width: double.infinity,
-      height: 54,
+      height: 58,
       padding: const EdgeInsets.fromLTRB(4, 6, 4, 6),
       decoration: BoxDecoration(
           color: Colors.white,

+ 2 - 1
lib/view/home/field_control/field_control.dart

@@ -56,10 +56,11 @@ class FieldControlPage extends StatelessWidget {
     final focusUser = c.focusUser;
     if (focusUser != null) {
       children.add(ViewMapCP(
-        key:UniqueKey(),
+        // key:UniqueKey(),
         map.plugMap,
         cpWantAndHistoryList: focusUser.cpList,
         isHideRouteBeforeStart: false,
+        controller: c.viewCpController,
       ));
     }
 

+ 27 - 3
lib/view/home/field_control/field_control_controller.dart

@@ -1,9 +1,14 @@
+import 'dart:async';
+
 import 'package:application/service/map_watch.dart';
+import 'package:common_pub/ui/map_view/view_map_cp.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();
@@ -11,19 +16,35 @@ class FieldControlController extends GetxController {
     if (map != null) {
       activeList.bindStream(map.activeList.stream);
     }
+
+    _subActive = activeList.listen((p0) {
+      final user  = focusUser;
+      if(user != null){
+        viewCpController.setCPList(user.cpList);
+      }
+    });
+
   }
 
+
+  @override
+  void onClose() {
+    super.onClose();
+    _subActive?.cancel();
+  }
+  final viewCpController = ViewMapCPController();
+  StreamSubscription<List<ActiveInfo>>? _subActive;
   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{
+
+  UserInfo? findFocusUser( List<ActiveInfo> list){
     if(focusUserId.value== null){
       return null;
     }
 
-    for(final act in activeList){
+    for(final act in list){
       for(final user in act.userList){
         if(user.id == focusUserId.value){
           return user;
@@ -32,4 +53,7 @@ class FieldControlController extends GetxController {
     }
     return null;
   }
+  UserInfo? get focusUser{
+    return findFocusUser(activeList);
+  }
 }

+ 43 - 0
macos/Podfile

@@ -0,0 +1,43 @@
+platform :osx, '10.14'
+
+# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
+ENV['COCOAPODS_DISABLE_STATS'] = 'true'
+
+project 'Runner', {
+  'Debug' => :debug,
+  'Profile' => :release,
+  'Release' => :release,
+}
+
+def flutter_root
+  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
+  unless File.exist?(generated_xcode_build_settings_path)
+    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
+  end
+
+  File.foreach(generated_xcode_build_settings_path) do |line|
+    matches = line.match(/FLUTTER_ROOT\=(.*)/)
+    return matches[1].strip if matches
+  end
+  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
+end
+
+require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
+
+flutter_macos_podfile_setup
+
+target 'Runner' do
+  use_frameworks!
+  use_modular_headers!
+
+  flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
+  target 'RunnerTests' do
+    inherit! :search_paths
+  end
+end
+
+post_install do |installer|
+  installer.pods_project.targets.each do |target|
+    flutter_additional_macos_build_settings(target)
+  end
+end

+ 1 - 1
pubspec.yaml

@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
 # In Windows, build-name is used as the major, minor, and patch parts
 # of the product and file versions while build-number is used as the build suffix.
-version: 1.0.3+1
+version: 1.0.4+1
 
 environment:
   sdk: '>=3.0.6 <4.0.0'

+ 1 - 1
third_party/common_pub

@@ -1 +1 @@
-Subproject commit f8c8ee6e737e33676d4378daf4d09cf7a4e43e5b
+Subproject commit 1f1aaed8ef70130fee50f9001556b5f813cd6075