Browse Source

实时打点

周睿 2 years ago
parent
commit
48d29ee89f

+ 26 - 2
android/app/build.gradle

@@ -20,6 +20,11 @@ def flutterVersionName = localProperties.getProperty('flutter.versionName')
 if (flutterVersionName == null) {
     flutterVersionName = '1.0'
 }
+def keystoreProperties = new Properties()
+def keystorePropertiesFile = rootProject.file('key.properties')
+if (keystorePropertiesFile.exists()) {
+    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
+}
 
 apply plugin: 'com.android.application'
 apply plugin: 'kotlin-android'
@@ -53,14 +58,33 @@ android {
         versionName flutterVersionName
     }
 
+    signingConfigs {
+
+        release {
+            keyAlias keystoreProperties['keyAlias']
+            keyPassword keystoreProperties['keyPassword']
+            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
+            storePassword keystoreProperties['storePassword']
+        }
+    }
     buildTypes {
         release {
-            // Signing with the debug keys for now, so `flutter run --release` works.
-            signingConfig signingConfigs.debug
+            minifyEnabled false
+            shrinkResources false
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+            signingConfig signingConfigs.release
         }
     }
+
+
 }
 
+
+
+
+
+
+
 flutter {
     source '../..'
 }

+ 10 - 0
android/app/proguard-rules.pro

@@ -0,0 +1,10 @@
+-keep class com.android.chileaf.**  { *; }
+#高德地图SDK配置
+-keep   class com.amap.api.maps.**{*;}
+-keep   class com.autonavi.**{*;}
+-keep   class com.amap.api.trace.**{*;}
+#高德等位SDK配置
+-keep class com.amap.api.location.**{*;}
+-keep class com.amap.api.fence.**{*;}
+-keep class com.loc.**{*;}
+-keep class com.autonavi.aps.amapapi.model.**{*;}

+ 74 - 22
lib/view/home/data_detail/data_detail.dart

@@ -48,34 +48,35 @@ class DataDetailPage extends StatelessWidget {
   Widget content(
       BuildContext context, MapWatchService map, DataDetailController c) {
     return Obx(() {
-      final children = <Widget>[
-        ViewPlugLoading(map.plugMap),
-        ViewMapImage(map.plugMap),
-      ];
-      final data = c.selectedDetail.value;
-      if (data != null) {
-        children.add(ViewMapCP(
-          map.plugMap,
-          cpWantAndHistoryList: data.controlPoints,
-          isHideRouteBeforeStart: false,
-          isShowPath: false,
-          cpTheme: ViewMapCPTheme()
-            ..cpJumpColor = cpColor
-            ..cpPunchedColor = cpColor,
-        ));
-
-        children.add(ViewMapTrace(map.plugMap, data.traceList,
-            controller: c.viewMapTraceController));
-      }
-
-      children.add(ViewMapTouch(map.plugMap));
+      // final children = <Widget>[
+      //   ViewPlugLoading(map.plugMap),
+      //   ViewMapImage(map.plugMap),
+      // ];
+      // final data = c.selectedDetail.value;
+      // if (data != null) {
+      //   children.add(ViewMapCP(
+      //     map.plugMap,
+      //     cpWantAndHistoryList: data.controlPoints,
+      //     isHideRouteBeforeStart: false,
+      //     isShowPath: false,
+      //     cpTheme: ViewMapCPTheme()
+      //       ..cpJumpColor = cpColor
+      //       ..cpPunchedColor = cpColor,
+      //   ));
+      //
+      //   children.add(ViewMapTrace(map.plugMap, data.traceList,
+      //       controller: c.viewMapTraceController));
+      // }
+      //
+      // children.add(ViewMapTouch(map.plugMap));
 
       return Row(children: [
         Expanded(
             child: Column(
           children: [
             Expanded(
-                child: ViewMapStack(plug: map.plugMap, children: children)),
+                child: ViewMapStack(plug: map.plugMap,
+                    children: [ SizedBox.expand(child: _MapContent())])),
             _traceBarView(c)
           ],
         )),
@@ -117,7 +118,58 @@ class DataDetailPage extends StatelessWidget {
     );
   }
 }
+class _MapContent extends GetView<DataDetailController>{
+  static const cpColor = Color(0xffcc00ff);
+  @override
+  Widget build(BuildContext context) {
+    return Obx((){
+      final map = controller.mapWatch!;
+
+      final children = <Widget>[
+        ViewPlugLoading(map.plugMap),
+        ViewMapImage(map.plugMap),
 
+      ];
+      final data = controller.selectedDetail.value;
+      if (data != null) {
+
+
+        children.add(
+          Container(
+            color: Colors.white.withAlpha(120),
+          ),
+        );
+
+        if(controller.selectedLoading.value){
+          children.add(const Center(child: CircularProgressIndicator()));
+        }else{
+          children.add(ViewMapCP(
+            key: UniqueKey(),
+            map.plugMap,
+            cpWantAndHistoryList: data.controlPoints,
+            isHideRouteBeforeStart: false,
+            isShowPath: false,
+            cpTheme: ViewMapCPTheme()
+              ..cpJumpColor = cpColor
+              ..cpPunchedColor = cpColor,
+          ));
+
+          children.add(ViewMapTrace(
+              key: UniqueKey(),
+              map.plugMap, data.traceList,
+              controller: controller.viewMapTraceController));
+        }
+      }
+
+      children.add(ViewMapTouch(map.plugMap));
+
+      return Stack(
+          alignment: Alignment.topLeft,
+          children: children);
+    });
+  }
+
+}
 class _UserListView extends GetView<DataDetailController> {
   @override
   Widget build(BuildContext context) {

+ 16 - 7
lib/view/home/data_detail/data_detail_controller.dart

@@ -36,6 +36,8 @@ class DataDetailController extends GetxController {
   final traceBarController = TraceBarController();
   final viewMapTraceController = ViewMapTraceController();
   StreamSubscription<int?>? _subscriptionTrace;
+  final selectedLoading = false.obs;
+
   @override
   void onInit() {
     super.onInit();
@@ -74,14 +76,21 @@ class DataDetailController extends GetxController {
   void selectDetail(DetailSimple d, UserInfo user) async {
     selectedDetailSimple.value = d;
     selectedUserId.value = user.data.oId;
-    final detail = HistoryDetail(await ApiService.to.stub
-        .toHistoryGameDetail(IdRequest(id: Int64(d.gameId))));
-    await detail.init(mapWatch!.plugMap.gameMap);
-    final old = selectedDetail.value;
-    selectedDetail.value = detail;
-    if (old != null) {
-      old.dispose();
+    selectedLoading.value = true;
+    try{
+      final detail = HistoryDetail(await ApiService.to.stub
+          .toHistoryGameDetail(IdRequest(id: Int64(d.gameId))));
+      await detail.init(mapWatch!.plugMap.gameMap);
+      final old = selectedDetail.value;
+      selectedDetail.value = detail;
+      debug('select: ${detail.data.gameId}');
+      if (old != null) {
+        old.dispose();
+      }
+    }finally{
+      selectedLoading.value = false;
     }
+
   }
 
   @override

+ 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.0+1
+version: 1.0.1+1
 
 environment:
   sdk: '>=3.0.6 <4.0.0'