flutter_autostart_android 1.0.0 copy "flutter_autostart_android: ^1.0.0" to clipboard
flutter_autostart_android: ^1.0.0 copied to clipboard

PlatformAndroid

A Flutter port of the Android AutoStarter library that helps bring up the autostart permission manager on various OEM devices.

Flutter Autostart Android #

pub package license

A Flutter port of the Android AutoStarter library that helps bring up the autostart permission manager on various OEM devices.

About #

This package is a Flutter implementation of the original Android AutoStarter library created by judemanutd. All credit for the core functionality and manufacturer-specific implementations goes to the original project.

Why this package? #

Many Android OEMs with custom UIs (like Xiaomi, Letv, etc.) restrict background processes by default, which can prevent your Flutter app from receiving push notifications or performing background tasks. This package provides a cross-platform way to request autostart permissions on supported devices.

Features #

  • Detect if autostart permission is required on the current device
  • Open the OEM-specific autostart permission screen
  • Supports multiple manufacturers (see list below)
  • Simple API that works across platforms (unsupported platforms fail gracefully)

Installation #

Add this to your pubspec.yaml:

dependencies:
  flutter_autostart_android: ^1.0.0
copied to clipboard

Usage #

Import the package:

import 'package:flutter_autostart_android/flutter_autostart_android.dart';
copied to clipboard

Check if autostart is available #

bool isAvailable = await FlutterAutostartAndroid.isAutoStartPermissionAvailable();
copied to clipboard

Request autostart permission #

bool success = await FlutterAutostartAndroid.requestAutoStartPermission();
copied to clipboard

Handle the response #

if (!success) {
  // Show instructions to user or fallback behavior
}
copied to clipboard

Supported Manufacturers #

The package currently supports:

  1. Xiaomi/Redmi
  2. Letv
  3. Honor
  4. Oppo
  5. Vivo
  6. Huawei
  7. Samsung
  8. Asus
  9. OnePlus

Note: Some implementations are untested - contributions welcome!

Platform Notes #

  • Android: Fully supported with OEM-specific implementations (based on original AutoStarter library)
  • iOS: No-op (returns false) as this concept doesn't exist on iOS
  • Web: No-op (returns false)

Original Android library: AutoStarter

For more background on Android background restrictions:

Contributing #

Contributions are welcome! Please open issues or PRs for:

  • New OEM implementations
  • Bug fixes
  • Test coverage improvements
0
likes
160
points
95
downloads

Publisher

verified publisheraminnez.com

Weekly Downloads

2024.10.06 - 2025.04.20

A Flutter port of the Android AutoStarter library that helps bring up the autostart permission manager on various OEM devices.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_autostart_android