|
@@ -66,6 +66,7 @@ class LocationAnalyseController extends BaseController
|
|
|
|
|
|
|
|
late AnimationController keywordLottieController =
|
|
late AnimationController keywordLottieController =
|
|
|
AnimationController(vsync: this);
|
|
AnimationController(vsync: this);
|
|
|
|
|
+ bool _keywordLottieReady = false;
|
|
|
|
|
|
|
|
Timer? _loopTimer;
|
|
Timer? _loopTimer;
|
|
|
|
|
|
|
@@ -226,12 +227,20 @@ class LocationAnalyseController extends BaseController
|
|
|
_isRequestedAnalyse.value = false;
|
|
_isRequestedAnalyse.value = false;
|
|
|
_isRequestingStream = false;
|
|
_isRequestingStream = false;
|
|
|
debugPrintStack();
|
|
debugPrintStack();
|
|
|
|
|
+ _setAnalyseSuccess();
|
|
|
});
|
|
});
|
|
|
}).catchError((error) {
|
|
}).catchError((error) {
|
|
|
_isRequestedAnalyse.value = false;
|
|
_isRequestedAnalyse.value = false;
|
|
|
_isRequestingStream = false;
|
|
_isRequestingStream = false;
|
|
|
if (error is ServerErrorException) {
|
|
if (error is ServerErrorException) {
|
|
|
- _summaryError.value = error.message ?? "服务出错,请稍后再试";
|
|
|
|
|
|
|
+ final msg = error.message;
|
|
|
|
|
+ if (msg == null) {
|
|
|
|
|
+ _summaryError.value = error.message ?? "服务出错,请稍后再试";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ graduallyController.append(msg);
|
|
|
|
|
+ graduallyController.appendDone();
|
|
|
|
|
+ }
|
|
|
|
|
+ _setAnalyseSuccess();
|
|
|
} else {
|
|
} else {
|
|
|
_summaryError.value = "网络错误,请检查网络连接";
|
|
_summaryError.value = "网络错误,请检查网络连接";
|
|
|
debugPrint("error: $error");
|
|
debugPrint("error: $error");
|
|
@@ -241,18 +250,24 @@ class LocationAnalyseController extends BaseController
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void locationKeywordLottieLoad(LottieComposition composition) {
|
|
void locationKeywordLottieLoad(LottieComposition composition) {
|
|
|
|
|
+ _keywordLottieReady = true;
|
|
|
keywordLottieController.duration = composition.duration;
|
|
keywordLottieController.duration = composition.duration;
|
|
|
_startKeywordLottieAnimation();
|
|
_startKeywordLottieAnimation();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _startKeywordLottieAnimation() async {
|
|
void _startKeywordLottieAnimation() async {
|
|
|
|
|
+ if (!_keywordLottieReady) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
await keywordLottieController.animateTo(0.84);
|
|
await keywordLottieController.animateTo(0.84);
|
|
|
keywordLottieController.repeat(min: 0, max: 0.84, reverse: true);
|
|
keywordLottieController.repeat(min: 0, max: 0.84, reverse: true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _setAnalyseSuccess() async {
|
|
void _setAnalyseSuccess() async {
|
|
|
_loopTimer?.cancel();
|
|
_loopTimer?.cancel();
|
|
|
- await keywordLottieController.animateTo(1);
|
|
|
|
|
|
|
+ if (_keywordLottieReady) {
|
|
|
|
|
+ await keywordLottieController.animateTo(1);
|
|
|
|
|
+ }
|
|
|
_isRequestedAnalyse.value = true;
|
|
_isRequestedAnalyse.value = true;
|
|
|
}
|
|
}
|
|
|
|
|
|