0 purchases
autostarter
autostarter #
A Flutter plugin for managing the autostart permission feature on Android devices.
Features #
Check if the autostart permission feature is available on the device.
Get the autostart permission by opening the autostart settings activity.
Check the autostart permission state (specific to MIUI devices).
Retrieve the list of whitelisted packages (specific to MIUI devices).
Getting Started #
Add the following dependency to your pubspec.yaml file:
dependencies:
autostarter: ^0.0.2
copied to clipboard
Import the package :
import 'package:autostarter/autostarter.dart';
copied to clipboard
Check Availability of Autostart Permission Feature :
bool? isAvailable = await Autostarter.isAutoStartPermissionAvailable();
if (isAvailable == true) {
// Autostart permission feature is available on the device
} else {
// Autostart permission feature is not available on the device
}
copied to clipboard
Request Autostart Permission :
await Autostarter.getAutoStartPermission(open: true, newTask: false);
copied to clipboard
Check Autostart Permission State (MIUI Devices) :
bool? isAutoStartEnabled = await Autostarter.checkAutoStartState();
if (isAutoStartEnabled == true) {
// Autostart permission is enabled on MIUI devices
} else {
// Autostart permission is disabled on MIUI devices
}
copied to clipboard
Get Whitelisted Packages (MIUI Devices) :
List<String> whitelistedPackages = await Autostarter.getWhitelistedPackages();
// Do something with the whitelisted package list
copied to clipboard
Acknowledgments : #
Thanks to the original Android native author judemanutd and XomaDev for the inspiration and codebase.
Feel free to modify the content according to your project's requirements.
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.