cake_wallet/lib/utils/brightness_util.dart
Omar Hatem 6dba73a1d5
Some checks failed
Cache Dependencies / test (push) Has been cancelled
Generic fixes (#1716)
* reset brightness after using

* set default qr to auto detect

* minor safety enhancement

* close socket after checking connectivity

* fix incorrect parent exception class

* pump medium and fast priorities even if they are equal to slow

* Add Ton to exchange

* fix silent payments
add Seth bitcoin node

* deselect quantex
add seth node for existing users

* fix node uri
2024-10-04 23:00:36 +03:00

20 lines
No EOL
538 B
Dart

import 'package:cake_wallet/utils/device_info.dart';
import 'package:device_display_brightness/device_display_brightness.dart';
class BrightnessUtil {
static Future<void> changeBrightnessForFunction(Future<void> Function() func) async {
// if not mobile, just navigate
if (!DeviceInfo.instance.isMobile) {
func();
return;
}
// ignore: unawaited_futures
DeviceDisplayBrightness.setBrightness(1.0);
await func();
// ignore: unawaited_futures
DeviceDisplayBrightness.resetBrightness();
}
}