Basically the title. Looking at the implementation:
public static boolean isIgnoringBatteryOptimizations(Context context) {
if (Build.VERSION.SDK_INT < 23) {
return true;
}
String packageName = context.getApplicationContext().getPackageName();
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
if (powerManager == null) {
return true;
}
return powerManager.isIgnoringBatteryOptimizations(packageName);
}
the method always returns a boolean, so the flutter implemenation could be changed to:
static Future<bool> get isBatteryOptimizationDisabled async {
return await _channel.invokeMethod("isBatteryOptimizationDisabled");
}
Basically the title. Looking at the implementation:
the method always returns a boolean, so the flutter implemenation could be changed to: