battery_optimize 0.1.12
battery_optimize: ^0.1.12 copied to clipboard

Check battery optimization status and request for disable

flutter_disable_battery_optimization #

Check for application battery optimization status and disable it

Getting Started #

Check if app is ignoring battery optimization #

BatteryOptimization.isIgnoringBatteryOptimizations().then((onValue) {
    setState(() {
        if (onValue) {
            // Igonring Battery Optimization
        } else {
            // App is under battery optimization
        }
    });
});

Take user to battery optimization settings #

Opens the battery optimization settings. Apps can be placed on the whitelist through the settings UI

BatteryOptimization.openBatteryOptimizationSettings();

Show battery optimization disable dialog #

Opens battery optimization disable dialog. Google Play can reject your app for this intent(ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS). Check here for exemption cases

BatteryOptimization.stopOptimizingBatteryUsage();
2
likes
70
pub points
58%
popularity

Check battery optimization status and request for disable

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

code.poet95@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on battery_optimize