AndroidManager class final

Manages Android-specific native configurations for Flutter projects.

This class provides methods to:

  • Update the minSdkVersion in Gradle build files
  • Add permissions to AndroidManifest.xml

Usage

final manager = AndroidManager('/path/to/flutter/project');

// Update minSdkVersion
final result = manager.updateMinSdk(23);

// Add a permission
final permResult = manager.addPermission('android.permission.CAMERA');

File Locations

The manager looks for files in these standard Flutter project locations:

  • android/app/build.gradle (Groovy DSL)
  • android/app/build.gradle.kts (Kotlin DSL)
  • android/app/src/main/AndroidManifest.xml

Constructors

AndroidManager(String projectRoot)
Creates a new AndroidManager for the Flutter project at projectRoot.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isAndroidProjectPresent bool
Returns true if the android/ directory exists in the project.
no setter
projectRoot String
The root directory of the Flutter project.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addPermission(String permissionName) OperationResult
Adds a permission to the AndroidManifest.xml file.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateMinSdk(int version) OperationResult
Updates the minSdkVersion in the Android Gradle build file.

Operators

operator ==(Object other) bool
The equality operator.
inherited