applyAndroidSplashImage function

Future<void> applyAndroidSplashImage({
  1. String? imageSource,
  2. String? color,
  3. String? gravity,
  4. YamlMap? android12AndAbove,
  5. String? backgroundImage,
  6. String? backgroundImageSource,
  7. String? backgroundImageGravity,
  8. String? darkImage,
  9. String? darkColor,
  10. String? darkGravity,
})

Apply the splash images to Android

Implementation

Future<void> applyAndroidSplashImage({
  String? imageSource,
  String? color,
  String? gravity,
  YamlMap? android12AndAbove,
  String? backgroundImage,
  String? backgroundImageSource,
  String? backgroundImageGravity,
  String? darkImage,
  String? darkColor,
  String? darkGravity,
}) async {
  await generateAndroidImages(
    imageSource: imageSource,
    darkImageSource: darkImage,
  );
  if (backgroundImageSource != null) {
    generateAndroidImages(
      imageSource: backgroundImageSource,
      backgroundImageName: AndroidStrings.splashBackgroundImagePng,
    );
  }
  await generateImageForAndroid12AndAbove(
    android12AndAbove: android12AndAbove,
  );
  await createColors(
    color: color,
  );
  if (darkColor != null) {
    await createColors(
      color: darkColor,
      isDark: true,
    );
  }
  await createSplashImageDrawable(
    imageSource: imageSource,
    color: color,
    gravity: gravity,
    backgroundImageSource: backgroundImageSource,
    backgroundImageGravity: backgroundImageGravity,
  );
  await createDarkSplashImageDrawable(
    darkImage: darkImage,
    color: darkColor,
    gravity: darkGravity,
  );
  await updateStylesXml(
    android12AndAbove: android12AndAbove,
    color: color,
  );
  if (darkImage != null) {
    await updateDarkStylesXml(
      android12AndAbove: android12AndAbove,
      color: darkColor,
    );
  }
}