mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
6dba73a1d5
Some checks failed
Cache Dependencies / test (push) Has been cancelled
* 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
20 lines
No EOL
538 B
Dart
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();
|
|
}
|
|
} |