Browse Source

界面调整

周睿 2 years ago
parent
commit
0d0757ba65
1 changed files with 70 additions and 63 deletions
  1. 70 63
      lib/view/home/field_control/field_control.dart

+ 70 - 63
lib/view/home/field_control/field_control.dart

@@ -202,78 +202,85 @@ class _UserInfoView extends GetView<FieldControlController> {
           color: Colors.white, borderRadius: BorderRadius.circular(5)),
       padding: const EdgeInsets.fromLTRB(7, 11, 7, 11),
       margin: const EdgeInsets.only(top: 5),
-      child: Row(
+      child: Column(
         crossAxisAlignment: CrossAxisAlignment.start,
         children: [
-          Obx(() => Container(
-              margin: const EdgeInsets.only(top: 2),
-              decoration: BoxDecoration(
-                  color: data.flag.value.color,
-                  borderRadius: BorderRadius.circular(4)),
-              width: 7,
-              height: 16)),
-          const SizedBox(
-            width: 8,
-          ),
-          Expanded(
-              child: Column(
-            crossAxisAlignment: CrossAxisAlignment.start,
+          Row(
             children: [
-              Text.rich(TextSpan(
-                  text: data.name,
-                  children: [TextSpan(text: ' [${data.routeName}]')])),
-              const SizedBox(height: 5),
-              Row(
-                children: [
-                  container(null, cpInfo, Colors.blue),
-                  container(
-                      const Icon(
-                        Icons.favorite,
-                        size: 13,
-                        color: Colors.white,
-                      ),
-                      ' ${hr == 0 ? '--' : hr}',
-                      (data.gameInfo.otherInfo.hasHeartRatePercent()
-                              ? data.gameInfo.otherInfo.heartRatePercent
-                              : 0)
-                          .toHRPColor()),
-                  container(null, paceInfo, data.pace.color)
-                ],
+              Obx(() => Container(
+                  margin: const EdgeInsets.only(top: 2),
+                  decoration: BoxDecoration(
+                      color: data.flag.value.color,
+                      borderRadius: BorderRadius.circular(4)),
+                  width: 7,
+                  height: 16)),
+              const SizedBox(
+                width: 8,
+              ),
+              Expanded(
+                child: Text.rich(TextSpan(
+                    text: data.name,
+                    children: [TextSpan(text: ' [${data.routeName}]')])),
               ),
-              const SizedBox(height: 5),
-              Row(
+              GestureDetector(
+                onTap: () {
+                  controller.focusUser.value = data;
+                },
+                child: Obx(() => Icon(
+                      Icons.route,
+                      color: data.gameInfo.userId !=
+                              controller.focusUser.value?.gameInfo.userId
+                          ? Colors.grey
+                          : const Color(0xffffbb77),
+                    )),
+              ),
+              const SizedBox(width: 8),
+              GestureDetector(
+                onTap: () {
+                  data.isHide.value = !data.isHide.value;
+                },
+                child: Obx(() => Icon(
+                      data.isHide.value
+                          ? Icons.visibility_off
+                          : Icons.visibility,
+                      color: data.isHide.value
+                          ? Colors.grey
+                          : const Color(0xffffbb77),
+                    )),
+              )
+            ],
+          ),
+          Container(
+            margin: const EdgeInsets.only(left: 14),
+            child: Row(
+              children: [
+                container(null, cpInfo, Colors.blue),
+                container(
+                    const Icon(
+                      Icons.favorite,
+                      size: 13,
+                      color: Colors.white,
+                    ),
+                    ' ${hr == 0 ? '--' : hr}',
+                    (data.gameInfo.otherInfo.hasHeartRatePercent()
+                            ? data.gameInfo.otherInfo.heartRatePercent
+                            : 0)
+                        .toHRPColor()),
+                container(null, paceInfo, data.pace.color)
+              ],
+            ),
+          ),
+          const SizedBox(height: 5),
+          Container(
+              margin: const EdgeInsets.only(left: 14),
+              child: Row(
                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                 children: [
                   Text('距离 ${data.nextDistance.toString()}'),
                   Text('时间 ${data.duration.toAppString()}'),
                   Text('里程 ${data.distance.toString()}'),
                 ],
-              )
-            ],
-          )),
-          GestureDetector(
-            onTap: () {
-              controller.focusUser.value = data;
-            },
-            child: Obx(() => Icon(
-                  Icons.route,
-                  color: data.gameInfo.userId !=
-                          controller.focusUser.value?.gameInfo.userId
-                      ? Colors.grey
-                      : const Color(0xffffbb77),
-                )),
-          ),
-          const SizedBox(width: 8),
-          GestureDetector(
-            onTap: () {
-              data.isHide.value = !data.isHide.value;
-            },
-            child: Obx(() => Icon(
-                  data.isHide.value ? Icons.visibility_off : Icons.visibility,
-                  color:
-                      data.isHide.value ? Colors.grey : const Color(0xffffbb77),
-                )),
-          )
+              ))
         ],
       ),
     );
@@ -302,7 +309,7 @@ class _UserInfoView extends GetView<FieldControlController> {
         Text(text, style: const TextStyle(color: Colors.white, fontSize: 14)));
 
     return Container(
-      height: 18,
+      height: 20,
       padding: const EdgeInsets.fromLTRB(10, 0, 12, 0),
       margin: const EdgeInsets.only(right: 6),
       alignment: Alignment.center,