Skip to content
pubscout

flutter_plugin_android_lifecycle

2.0.35, released 6 months ago by flutter.dev

Flutter plugin for accessing Android Lifecycle within other plugins.

WASM-ready
$ flutter pub add flutter_plugin_android_lifecycle
Source repository

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.

Works with

Packages commonly used together with flutter_plugin_android_lifecycle: ones it builds on, ones built on it, and its own family.