fix: Remove uncompatible dependencies connectivity_plus and wakelock

This commit is contained in:
Krille 2023-10-08 19:38:57 +02:00
commit 35367389f0
No known key found for this signature in database
8 changed files with 8 additions and 85 deletions

View file

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:path_provider/path_provider.dart';
import 'package:record/record.dart';
import 'package:wakelock/wakelock.dart';
import 'package:wakelock_plus/wakelock_plus.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/utils/platform_infos.dart';
@ -45,7 +45,7 @@ class RecordingDialogState extends State<RecordingDialog> {
setState(() => error = true);
return;
}
await Wakelock.enable();
await WakelockPlus.enable();
await _audioRecorder.start(
path: _recordedPath,
bitRate: bitRate,
@ -77,7 +77,7 @@ class RecordingDialogState extends State<RecordingDialog> {
@override
void dispose() {
Wakelock.disable();
WakelockPlus.disable();
_recorderSubscription?.cancel();
_audioRecorder.stop();
super.dispose();

View file

@ -28,7 +28,7 @@ import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:just_audio/just_audio.dart';
import 'package:matrix/matrix.dart';
import 'package:vibration/vibration.dart';
import 'package:wakelock/wakelock.dart';
import 'package:wakelock_plus/wakelock_plus.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:fluffychat/utils/platform_infos.dart';
@ -223,7 +223,7 @@ class MyCallingPage extends State<Calling> {
if (call.type == CallType.kVideo) {
try {
// Enable wakelock (keep screen on)
unawaited(Wakelock.enable());
unawaited(WakelockPlus.enable());
} catch (_) {}
}
}
@ -235,7 +235,7 @@ class MyCallingPage extends State<Calling> {
);
if (call.type == CallType.kVideo) {
try {
unawaited(Wakelock.disable());
unawaited(WakelockPlus.disable());
} catch (_) {}
}
}