周睿 %!s(int64=2) %!d(string=hai) anos
pai
achega
c4adebe2ab
Modificáronse 3 ficheiros con 12 adicións e 2 borrados
  1. 1 0
      lib/service/map_watch.dart
  2. 10 1
      lib/view/home/field_control/field_control.dart
  3. 1 1
      pubspec.yaml

+ 1 - 0
lib/service/map_watch.dart

@@ -107,6 +107,7 @@ class UserInfo {
   Duration get duration =>
   Duration get duration =>
       DateTime.now().difference(gameInfo.gameSaveInfo.startAt.toModel());
       DateTime.now().difference(gameInfo.gameSaveInfo.startAt.toModel());
   Distance get distance => Distance(m: gameInfo.gpsInfo.distance.toDouble());
   Distance get distance => Distance(m: gameInfo.gpsInfo.distance.toDouble());
+  int get id => gameInfo.userId;
   var gameInfo = pb.ToOrienteerInGameInfo();
   var gameInfo = pb.ToOrienteerInGameInfo();
   var routeInfo = pb.CourseBaseInfo();
   var routeInfo = pb.CourseBaseInfo();
   var userInfo = pb.OrienteerBaseInfo();
   var userInfo = pb.OrienteerBaseInfo();

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

@@ -114,7 +114,9 @@ class _ViewTrace extends GetView<FieldControlController> {
               onMapTrace: traceTailOnMap,
               onMapTrace: traceTailOnMap,
               color: user.flag.value.color,
               color: user.flag.value.color,
             ));
             ));
-            children.add(ViewMapUserPoint(map.plugMap, trace,
+            children.add(ViewMapUserPoint(
+                key: UniqueKey(),
+                map.plugMap, trace,
                 info: user.name, color: user.flag.value.color));
                 info: user.name, color: user.flag.value.color));
           }
           }
         }
         }
@@ -224,6 +226,13 @@ class _UserInfoView extends GetView<FieldControlController> {
               ),
               ),
               GestureDetector(
               GestureDetector(
                 onTap: () {
                 onTap: () {
+                  final old = controller.focusUser.value;
+                  if(old != null){
+                    if(old.id == data.id){
+                      controller.focusUser.value = null;
+                      return;
+                    }
+                  }
                   controller.focusUser.value = data;
                   controller.focusUser.value = data;
                 },
                 },
                 child: Obx(() => Icon(
                 child: Obx(() => Icon(

+ 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
 # 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
 # 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.
 # of the product and file versions while build-number is used as the build suffix.
-version: 1.0.1+1
+version: 1.0.2+1
 
 
 environment:
 environment:
   sdk: '>=3.0.6 <4.0.0'
   sdk: '>=3.0.6 <4.0.0'