isIgnoringBatteryOptimizations static method

Future<bool> isIgnoringBatteryOptimizations()

Implementation

static Future<bool> isIgnoringBatteryOptimizations() async {
  // Android-only feature
  if (kIsWeb || !Platform.isAndroid) {
    return true;
  }

  // Query for Android battery optimization status
  return (await _channel
      .invokeMethod<bool>('isIgnoringBatteryOptimizations'))!;
}