nativeSplash static method
Implementation
static Future<void> nativeSplash() async {
final projectPath = DirectoryService.getValidProjectPath('lib');
await ScriptService.addPackages(
packages: ['flutter_native_splash'],
isDevDependency: true,
projectPath: projectPath
);
await ScriptService.flutterPubGet(projectPath);
final content = '''
flutter_native_splash:
fullscreen: true
color: "#ffffff"
image: assets/splash/splash.png
color_dark: "#121212"
# image_dark: assets/splash/splash_dark.png
android_12:
color: "#ffffff"
image: assets/splash/splash.png
color_dark: "#121212"
# image_dark: assets/splash/splash_dark.png
android: true
ios: true
web: false
''';
FileService.createFile(filePath: '$projectPath/flutter_native_splash.yaml', content: content);
Console.writeLine(green('✅ Done!'));
}