android library

Functions

copyXxxhdpiMipmapToDrawable(Config config, String? flavor, {required FLILogger logger, String prefixPath = '.'}) Future<void>
Copies the largest generated mipmap (mipmap-xxxhdpi/<icon>.png) into the same flavor's drawable/ folder under the same filename.
createAdaptiveIcons(Config config, String? flavor, {required FLILogger logger, String prefixPath = '.'}) Future<void>
createAdaptiveMonochromeIcons(Config config, String? flavor, {required FLILogger logger, String prefixPath = '.'}) Future<void>
createDefaultIcons(Config config, String? flavor, {required FLILogger logger, String prefixPath = '.'}) Future<void>
createMipmapXmlFile(Config config, String? flavor, {required FLILogger logger, String prefixPath = '.'}) Future<void>
createNewColorsFile(String backgroundColor, String? flavor, {String prefixPath = '.'}) Future<void>
Creates a colors.xml file if it was missing from android/app/src/main/res/values/colors.xml
detectMinSdkAndroid({String prefixPath = '.'}) Future<MinSdkDetection>
Like minSdk but additionally returns the human-readable label of the pattern that matched. Used by doctor to keep its report aligned with the generation pipeline's actual detection logic.
findAndroidGradleFile(String prefixPath) Future<File?>
Probes for the app-level Android gradle build file inside prefixPath.
isAdaptiveIconConfigPngFile(String backgroundFile) bool
Returns true if the adaptive icon background should be treated as an image file (vs a hex color literal). Anything that isn't a hex color literal is treated as a file path, supporting .png, .jpg, .jpeg, .webp, and any other extension the decoder accepts. The old endsWith('.png') check mis-routed non-PNG paths into colors.xml, breaking mergeDebugResources (upstream #616/#617/#665).
isAndroidIconNameCorrectFormat(String iconName) bool
Ensures that the Android icon name is in the correct format
isCorrectMipmapDirectoryForAdaptiveIcon(String dir) bool
(NOTE THIS IS JUST USED FOR UNIT TEST) Ensures the correct path is used for generating adaptive icons "Next you must create alternative drawable resources in your app for use with Android 8.0 (API level 26) in res/mipmap-anydpi/ic_launcher.xml" Source: https://developer.android.com/develop/ui/views/launch/icon_design_adaptive
isHexColorLiteral(String value) bool
True if the value is a hex color literal (#RGB, #RRGGBB, #AARRGGBB, unhashed forms, etc). Delegates to utils.isHexColorLiteral so the writer and the config model classify colors identically.
minSdk({String prefixPath = '.'}) Future<int?>
Retrieves the minSdk value for the project rooted at prefixPath.
overwriteAndroidManifestWithNewLauncherIcon(String iconName, File androidManifestFile) Future<void>
Updates the line which specifies the launcher icon within the AndroidManifest.xml with the new icon name (only if it has changed)
overwriteExistingIcons(AndroidIconTemplate template, Image image, String filename, String? flavor, {String prefixPath = '.'}) Future<void>
Overrides the existing launcher icons in the project Note: Do not change interpolation unless you end up with better results (see issue for result when using cubic interpolation) https://github.com/fluttercommunity/flutter_launcher_icons/issues/101#issuecomment-495528733
rejectVectorDrawableSource({required String field, required String value}) → void
Rejects vector-drawable (.xml) sources for adaptive foreground / monochrome with a clear, actionable error. The image pipeline cannot rasterize XML drawables; the previous behavior was an opaque getter 'width' was called on null deep inside the image package.
resolveMinSdkAndroid({required String prefixPath, required FLILogger logger, required int? explicit}) Future<int>
Resolves the effective Android min_sdk_android for a generation run.
updateColorsFile(File colorsFile, String backgroundColor) Future<void>
Updates the colors.xml with the new adaptive launcher icon color.
updateColorsXmlFile(String backgroundConfig, String? flavor, {required FLILogger logger, String prefixPath = '.'}) Future<void>
Retrieves the colors.xml file for the project.