flutter_plugin_android_lifecycle
2.0.35, released 6 months ago by flutter.dev
Flutter plugin for accessing Android Lifecycle within other plugins.
What it does
Allows other Flutter plugins to access Android Lifecycle objects in the plugin's binding. Forces plugins to have a pub constraint signifying the major version of the Android Lifecycle API they expect.
AI-written summary of version 2.0.35, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are developing a Flutter plugin that needs access to the Android Lifecycle API.
- You want to use FlutterLifecycleAdapter within an Android plugin implementation.
Skip it when
- You are building a standard Flutter application rather than a plugin.
- You do not need to interact with native Android lifecycle components.
Strengths
- Enables safe access to Android Lifecycle objects for plugin developers.
- Enforces pub constraints for major Android Lifecycle API versions.
Weaknesses
- Limited to Android platform integration.
- Requires native Android implementation knowledge.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Used as a dependency in other Android-specific Flutter plugins with a minimum Android SDK of 24.
import androidx.lifecycle.Lifecycle;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
import io.flutter.embedding.engine.plugins.lifecycle.FlutterLifecycleAdapter;
Lifecycle lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(binding);Alternatives
Packages that do the same job and could replace flutter_plugin_android_lifecycle.
- bluetooth_enable_fork
Plugin to programmatically enable Bluetooth in Flutter apps
50Compare
Works with
Packages commonly used together with flutter_plugin_android_lifecycle: ones it builds on, ones built on it, and its own family.
- plugin_platform_interfaceSame familyReusable base class for platform interfaces of Flutter federated plugins.
- flutter_plugin_toolsSame familyCLI tool for managing, testing, and releasing packages across Flutter team repositories
- local_auth_androidBuilt on flutter_plugin_android_lifecycleAndroid implementation of the local_auth plugin for biometric authentication.
- google_maps_flutter_androidBuilt on flutter_plugin_android_lifecycleAndroid implementation of the google_maps_flutter plugin.
- cameraBuilt on flutter_plugin_android_lifecycleFlutter plugin to preview, capture photos/video and stream camera images.
- camera_androidBuilt on flutter_plugin_android_lifecycleAndroid implementation of the camera plugin using the Camera2 library.
- image_picker_androidBuilt on flutter_plugin_android_lifecycleAndroid implementation of the image_picker plugin for selecting photos and videos.
- freeraspBuilt on flutter_plugin_android_lifecycleFlutter SDK for runtime app self-protection and threat monitoring on Android and iOS.