PlusPlugins

repository·main·Indexed 23 days ago

https://github.com/fluttercommunity/plus_plugins

A community-maintained suite of Flutter plugins that extends the original plugin ecosystem. Includes packages such as android_alarm_manager_plus for background tasks and alarm scheduling, android_intent_plus for launching Android intents, battery_plus for monitoring battery level and state, and connectivity_plus for discovering network connectivity types.

Tokens
14.9K
Snippets
30
Records
89
Agent score
84%

What's inside plus_plugins

  1. Overview of Plus Plugins

    main
    PlusPlugins is a collection of Flutter plugins developed as enhanced versions of the original Flutter plugins. They provide extra functionalities, support for more platforms, and improved maintenance. These plugins are designed to help developers access device hardware, system information, and platform-specific services in Flutter applications.
  2. Identify the app installer store with installerStore

    main

    The installerStore property returns a string indicating which app store installed the application. This is useful for directing users to the correct store for updates or ratings.

    • iOS: Returns values based on the app store receipt path (e.g., com.apple for App Store, com.apple.testflight for TestFlight).
    • Android: Returns the package name of the installer (e.g., com.android.vending for Google Play Store).
    • Other Platforms: Returns null on macOS, Linux, Windows, and Web.

    Note: Some Android stores may return null if they do not properly implement the installer package name API.

    PackageInfo packageInfo = await PackageInfo.fromPlatform();
    String? installerStore = packageInfo.installerStore;
  3. Get device information with `device_info_plus`

    main

    The device_info_plus plugin provides detailed information about the device (such as make and model) and the specific Android or iOS version the application is running on.

    Platform Support:

    • Android, iOS, macOS, Web, Linux, Windows
  4. Schedule alarms with AndroidAlarmManager

    main

    The AndroidAlarmManager class provides methods to schedule tasks in the background.

    Important Concepts:

    • Isolates: Alarm callbacks run in a separate isolate from the main application. They do not share memory. Communication must be handled via message passing.
    • Annotation: Always annotate your callback function with @pragma('vm:entry-point') to ensure it is not stripped in release mode (required for Flutter >= 3.3.0).
    • Persistence: Alarms are cleared if the device is rebooted. You must reschedule them if you want them to persist across reboots.
  5. Platform restrictions for Magnetometer and Barometer

    main

    Certain sensors are unavailable or limited on specific platforms:

    • Web:
      • The Magnetometer API is not supported by modern web browsers.
      • The Barometer API does not exist for web platforms.
      • Developers should implement fallback logic or inform users of these limitations.
    • Android: Some low-end or older devices may lack specific sensors. Always use onError in your stream listeners to handle missing hardware gracefully.