PlusPlugins
repository·main·Indexed 23 days ago
https://github.com/fluttercommunity/plus_pluginsA 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.
What's inside plus_plugins
- 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.
Query application package info with `package_info_plus`
mainThe
package_info_plusplugin allows you to query information about the application package, such asCFBundleVersionon iOS orversionCodeon Android.Platform Support:
- Android, iOS, macOS, Web, Linux, Windows
Launch Android Intents with `android_intent_plus`
mainThe
android_intent_plusplugin is used for launching Android Intents.Platform Support:
- Android only (Not supported on iOS)
Identify the app installer store with installerStore
mainThe
installerStoreproperty 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.applefor App Store,com.apple.testflightfor TestFlight). - Android: Returns the package name of the installer (e.g.,
com.android.vendingfor Google Play Store). - Other Platforms: Returns
nullon macOS, Linux, Windows, and Web.
Note: Some Android stores may return
nullif they do not properly implement the installer package name API.PackageInfo packageInfo = await PackageInfo.fromPlatform(); String? installerStore = packageInfo.installerStore;- iOS: Returns values based on the app store receipt path (e.g.,
Access sensors with `sensors_plus`
mainThe
sensors_plusplugin provides access to hardware sensors including the accelerometer, gyroscope, magnetometer, and barometer.Platform Support:
- Android, iOS, Web, Linux (Note: macOS and Windows are not supported)
Get device information with `device_info_plus`
mainThe
device_info_plusplugin 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
Schedule alarms with AndroidAlarmManager
mainThe
AndroidAlarmManagerclass 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.
Discover network info with `network_info_plus`
mainThe
network_info_plusplugin is used for discovering network information.Platform Support:
- Android, iOS, macOS, Linux, Windows (Note: Web is not supported)
Discover network connectivity with `connectivity_plus`
mainThe
connectivity_plusplugin is used to discover the state of network connectivity, specifically WiFi and mobile/cellular connections, on Android and iOS.Platform Support:
- Android, iOS, macOS, Web, Linux, Windows
Platform restrictions for Magnetometer and Barometer
mainCertain 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
onErrorin your stream listeners to handle missing hardware gracefully.
- Web:
Run background tasks on Android with `android_alarm_manager_plus`
mainThe
android_alarm_manager_plusplugin provides access to the AndroidAlarmManagerservice, enabling you to run Dart code in the background when alarms fire.Platform Support:
- Android only
Share content with `share_plus`
mainThe
share_plusplugin allows you to share content via the platform's native share UI. It uses theACTION_SENDintent on Android andUIActivityViewControlleron iOS.Platform Support:
- Android, iOS, macOS, Web, Linux, Windows