mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
21 lines
539 B
Dart
21 lines
539 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();
|
|
}
|
|
}
|