|
@@ -24,10 +24,7 @@ import 'package:path_provider/path_provider.dart';
|
|
|
import 'package:record/record.dart';
|
|
import 'package:record/record.dart';
|
|
|
import 'package:uuid/uuid.dart';
|
|
import 'package:uuid/uuid.dart';
|
|
|
import 'package:wakelock_plus/wakelock_plus.dart';
|
|
import 'package:wakelock_plus/wakelock_plus.dart';
|
|
|
-
|
|
|
|
|
-import '../../dialog/desktop_shortcut_dialog.dart';
|
|
|
|
|
import '../../utils/pcm_wav_converter.dart';
|
|
import '../../utils/pcm_wav_converter.dart';
|
|
|
-import '../../widget/frame_animation_view.dart';
|
|
|
|
|
|
|
|
|
|
class RecordController extends BaseController {
|
|
class RecordController extends BaseController {
|
|
|
static const String keyLastRecordId = "last_record_id";
|
|
static const String keyLastRecordId = "last_record_id";
|
|
@@ -94,10 +91,10 @@ class RecordController extends BaseController {
|
|
|
WidgetsBinding.instance
|
|
WidgetsBinding.instance
|
|
|
.addPostFrameCallback((_) => FlutterForegroundTask.init(
|
|
.addPostFrameCallback((_) => FlutterForegroundTask.init(
|
|
|
androidNotificationOptions: AndroidNotificationOptions(
|
|
androidNotificationOptions: AndroidNotificationOptions(
|
|
|
- channelId: StringName.recordNotificationChannelId,
|
|
|
|
|
- channelName: StringName.recordNotificationChannelName,
|
|
|
|
|
|
|
+ channelId: StringName.recordNotificationChannelId.tr,
|
|
|
|
|
+ channelName: StringName.recordNotificationChannelName.tr,
|
|
|
channelDescription:
|
|
channelDescription:
|
|
|
- StringName.recordNotificationChannelDescription,
|
|
|
|
|
|
|
+ StringName.recordNotificationChannelDescription.tr,
|
|
|
channelImportance: NotificationChannelImportance.LOW,
|
|
channelImportance: NotificationChannelImportance.LOW,
|
|
|
priority: NotificationPriority.LOW,
|
|
priority: NotificationPriority.LOW,
|
|
|
),
|
|
),
|
|
@@ -357,4 +354,10 @@ class RecordController extends BaseController {
|
|
|
File file = File("${documentDir.path}/.atmob/record/$lastRecordId");
|
|
File file = File("${documentDir.path}/.atmob/record/$lastRecordId");
|
|
|
return await file.exists() && await file.length() > 0;
|
|
return await file.exists() && await file.length() > 0;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ canPop() async {
|
|
|
|
|
+ if (currentStatus.value == RecordStatus.recording) {
|
|
|
|
|
+ return _stopRecord();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|