applyAndroidSplashImage function
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,
);
}
}