소스 검색

Merge branch 'v1.1.0' of git.atmob.com:Atmob-Flutter/location2025 into v1.1.0

“HeShaoZe” 4 달 전
부모
커밋
70f4ecc8b1
2개의 변경된 파일36개의 추가작업 그리고 44개의 파일을 삭제
  1. 20 28
      lib/module/analyse/location_analyse_controller.dart
  2. 16 16
      pubspec.yaml

+ 20 - 28
lib/module/analyse/location_analyse_controller.dart

@@ -9,7 +9,6 @@ import 'package:location/base/base_controller.dart';
 import 'package:location/data/bean/user_info.dart';
 import 'package:location/data/repositories/track_repository.dart';
 import 'package:location/sdk/map/map_helper.dart';
-import 'package:location/utils/atmob_log.dart';
 import 'package:lottie/lottie.dart';
 import 'package:video_player/video_player.dart';
 import '../../data/bean/stream_chat_origin_data.dart';
@@ -69,12 +68,9 @@ class LocationAnalyseController extends BaseController
       AnimationController(vsync: this);
 
   Timer? _loopTimer;
-  bool _triggerFinalLoop = false;
 
-  //视频播放总长度 8175毫秒
-  Duration videoTotalDuration = const Duration(milliseconds: 8175);
-  Duration loopStart = const Duration(milliseconds: 5670);
-  Duration loopEnd = const Duration(milliseconds: 6570);
+  Duration loopStart = const Duration(milliseconds: 0);
+  Duration loopEnd = const Duration(milliseconds: 5032);
 
   LocationAnalyseController(this.trackRepository);
 
@@ -86,7 +82,6 @@ class LocationAnalyseController extends BaseController
     _getErrorAddr();
 
     graduallyController.setGraduallyFinishedListener(() {
-      _isRequestedAnalyse.value = true;
       _isRequestingStream = false;
     });
 
@@ -96,8 +91,6 @@ class LocationAnalyseController extends BaseController
       ..setVolume(0.0)
       ..initialize().then((_) {
         _videoReady.value = true;
-        locaController.play();
-        AtmobLog.d('zk', "duration:${locaController.value.duration}");
         _startMonitorLoop();
       }).catchError((error) {
         debugPrint('Error initializing video: $error');
@@ -105,26 +98,13 @@ class LocationAnalyseController extends BaseController
   }
 
   void _startMonitorLoop() {
+    locaController.play();
     _loopTimer =
         Timer.periodic(const Duration(milliseconds: 100), (timer) async {
       final position = await locaController.position;
       if (position == null) return;
-
-      // 第一阶段:0~6s,播放完成后进入循环
-      if (!_triggerFinalLoop) {
-        if (position >= loopEnd) {
-          // 循环 4~6s
-          locaController.seekTo(loopStart);
-        }
-      } else {
-        // 第二阶段:触发后进入 6~8s 循环
-        if (loopStart != const Duration(seconds: 6)) {
-          loopStart = const Duration(seconds: 6);
-          loopEnd = videoTotalDuration;
-        }
-        if (position >= loopEnd) {
-          locaController.seekTo(loopStart);
-        }
+      if (position >= loopEnd) {
+        locaController.seekTo(loopStart);
       }
     });
   }
@@ -171,6 +151,11 @@ class LocationAnalyseController extends BaseController
   }
 
   void onTrackRefreshClick() {
+    if (_isRequestingStream) {
+      return;
+    }
+    _startMonitorLoop();
+    _startKeywordLottieAnimation();
     _analyseErrorAddr();
   }
 
@@ -255,18 +240,25 @@ class LocationAnalyseController extends BaseController
     });
   }
 
-  void locationKeywordLottieLoad(LottieComposition composition) async {
+  void locationKeywordLottieLoad(LottieComposition composition) {
     keywordLottieController.duration = composition.duration;
+    _startKeywordLottieAnimation();
+  }
+
+  void _startKeywordLottieAnimation() async {
     await keywordLottieController.animateTo(0.84);
     keywordLottieController.repeat(min: 0, max: 0.84, reverse: true);
   }
 
-  void _setAnalyseSuccess() {
-    keywordLottieController.animateTo(1);
+  void _setAnalyseSuccess() async {
+    _loopTimer?.cancel();
+    await keywordLottieController.animateTo(1);
+    _isRequestedAnalyse.value = true;
   }
 
   @override
   void onClose() {
+    _loopTimer?.cancel();
     _streamSubscription?.cancel();
     keywordLottieController.dispose();
     super.onClose();

+ 16 - 16
pubspec.yaml

@@ -35,17 +35,17 @@ dependencies:
   get: 4.7.2
 
   # 网络
-  dio: ^5.8.0+1
+  dio: 5.7.0
   pretty_dio_logger: 1.4.0
-  retrofit: ^4.6.0
+  retrofit: 4.4.1
   json_annotation: 4.9.0
 
   #获取设备信息
-  device_info_plus: ^11.5.0
+  device_info_plus: 10.1.2
   android_id: 0.4.0
 
   # 包信息
-  package_info_plus: ^8.3.0
+  package_info_plus: 8.1.1
 
   # 隐私追踪
   app_tracking_transparency: ^2.0.5
@@ -54,13 +54,13 @@ dependencies:
   flutter_screenutil: 5.9.3
 
   # 弹窗
-  flutter_smart_dialog: ^4.9.8+8
+  flutter_smart_dialog: 4.9.8
 
   #数据存储
   mmkv: 2.2.2
 
   #权限申请
-  permission_handler: ^12.0.1
+  permission_handler: 11.3.1
 
   #上、下拉刷新
   pull_to_refresh: 2.0.0
@@ -73,7 +73,7 @@ dependencies:
   injectable: 2.5.0
 
   #日期格式化等
-  intl: ^0.20.2
+  intl: 0.19.0
 
   #webview
   flutter_inappwebview: ^6.1.5
@@ -82,10 +82,10 @@ dependencies:
   marquee: 2.3.0
 
   #socket连接
-  web_socket_channel: ^3.0.3
+  web_socket_channel: 3.0.2
 
   #switch
-  animated_toggle_switch: ^0.8.5
+  animated_toggle_switch: 0.8.4
 
   #通讯录选择
   flutter_contacts: ^1.1.9+2
@@ -101,7 +101,7 @@ dependencies:
   flutter_cupertino_datetime_picker: ^3.0.0
 
   #拨号
-  url_launcher: ^6.3.2
+  url_launcher: 6.3.1
 
   #并发
   synchronized: ^3.3.0+2
@@ -195,7 +195,7 @@ dependencies:
       ref: v0.0.2
 
   flutter_umeng:
-   git:
+    git:
       url: http://git.atmob.com:28999/Atmob-Flutter/flutter_umeng.git
       ref: v0.0.3
 
@@ -211,15 +211,15 @@ dev_dependencies:
 
   retrofit_generator: '>=8.0.0 <10.0.0'
 
-  build_runner: ^2.5.4
+  build_runner: 2.4.13
 
-  json_serializable: ^6.9.5
+  json_serializable: 6.9.0
 
-  flutter_gen_runner: ^5.10.0
+  flutter_gen_runner: 5.9.0
 
-  flutter_lints: ^6.0.0
+  flutter_lints: ^5.0.0
 
-  injectable_generator: ^2.7.0
+  injectable_generator: 2.6.2
 
   string_get_runner:
     git: