mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-08 03:49:43 +00:00
fix
This commit is contained in:
parent
7e679e2b82
commit
80292b0e2e
1 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
import 'package:cake_wallet/utils/device_info.dart';
|
import 'package:cake_wallet/utils/device_info.dart';
|
||||||
import 'package:device_display_brightness/device_display_brightness.dart';
|
import 'package:screen_brightness/screen_brightness.dart';
|
||||||
|
|
||||||
class BrightnessUtil {
|
class BrightnessUtil {
|
||||||
static Future<void> changeBrightnessForFunction(Future<void> Function() func) async {
|
static Future<void> changeBrightnessForFunction(Future<void> Function() func) async {
|
||||||
|
@ -10,14 +10,14 @@ class BrightnessUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the current brightness:
|
// Get the current brightness:
|
||||||
final brightness = await DeviceDisplayBrightness.getBrightness();
|
final double brightness = await ScreenBrightness().current;
|
||||||
|
|
||||||
// ignore: unawaited_futures
|
// ignore: unawaited_futures
|
||||||
DeviceDisplayBrightness.setBrightness(1.0);
|
await ScreenBrightness().setScreenBrightness(1.0);
|
||||||
|
|
||||||
await func();
|
await func();
|
||||||
|
|
||||||
// ignore: unawaited_futures
|
// ignore: unawaited_futures
|
||||||
DeviceDisplayBrightness.setBrightness(brightness);
|
await ScreenBrightness().setScreenBrightness(brightness);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue