|
|
@@ -11,11 +11,13 @@ import 'package:get/get.dart';
|
|
|
import '../../data/consts/error_code.dart';
|
|
|
import '../../dialog/alert_dialog.dart';
|
|
|
import '../../router/app_pages.dart';
|
|
|
+import '../../utils/de_bounce.dart';
|
|
|
import '../../utils/http_handler.dart';
|
|
|
|
|
|
class RecordController extends BaseController {
|
|
|
Rx<RecordStatus> currentStatus = recordHandler.currentStatus;
|
|
|
RxDouble currentDuration = recordHandler.currentDuration;
|
|
|
+ final Debounce _saveDebounce = Debounce(debounceTime: 500);
|
|
|
|
|
|
@override
|
|
|
void onInit() {
|
|
|
@@ -76,11 +78,13 @@ class RecordController extends BaseController {
|
|
|
}
|
|
|
|
|
|
void onSaveClick() {
|
|
|
- if (currentStatus.value == RecordStatus.pending) {
|
|
|
- return;
|
|
|
- }
|
|
|
- EventHandler.report(EventId.event_100011);
|
|
|
- _saveCurrentRecord();
|
|
|
+ _saveDebounce.onClick(() {
|
|
|
+ if (currentStatus.value == RecordStatus.pending) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ EventHandler.report(EventId.event_100011);
|
|
|
+ _saveCurrentRecord();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
Future<void> _startOrContinueRecord() async {
|