A simple plugin to check if the app is ignoring battery optimizations (Android Only)
BatteryOptimization.isIgnoringBatteryOptimizations().then((onValue) {
setState(() {
if (onValue) {
// Igonring Battery Optimization
} else {
// App is under battery optimization
}
});
});
this opens the battery optimization settings. Apps can be placed on the whitelist through the settings UI
BatteryOptimization.openBatteryOptimizationSettings();