You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
549 B
22 lines
549 B
import 'package:flutter/services.dart';
|
|
|
|
class WakeLock {
|
|
static const _utils = const MethodChannel('com.cake_wallet/native_utils');
|
|
|
|
Future<void> enableWake() async {
|
|
try {
|
|
await _utils.invokeMethod<String>('enableWakeScreen');
|
|
} on PlatformException catch (_) {
|
|
print('Failed enabling screen wakelock');
|
|
}
|
|
}
|
|
|
|
Future<void> disableWake() async {
|
|
try {
|
|
await _utils.invokeMethod<String>('disableWakeScreen');
|
|
} on PlatformException catch (_) {
|
|
print('Failed enabling screen wakelock');
|
|
}
|
|
}
|
|
}
|