Is it possible to remove or hide the default splash screen provided by the system?
I have created a splah screen with flutter but default one i can’t remove it
here is the code:
import 'package:educationalapp/Screens/Wellcome.dart';
import 'package:educationalapp/values/colors.dart';
import 'package:flutter/material.dart';
class SplashScreen extends StatefulWidget {
const SplashScreen({super.key});
@override
State<SplashScreen> createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
@override
void initState() {
super.initState();
// Navigate to the Home screen after 5 seconds
Future.delayed(const Duration(seconds: 5), () {
Navigator.push(context, MaterialPageRoute(builder: (context) => const WellcomePage()));
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
height: double.infinity,
width: double.infinity,
decoration: const BoxDecoration(
color: mainColor,
),
child: const Center(
child: Image(image: AssetImage('assets/images/logo.png')),
),
),
);
}
}
I’m trying to add a Flutter package to my project and was wondering about the best approach to do this. Specifically, I would like to add a package without going through the full dependency management process.
Here’s what I’ve tried:
i add flutter_native_splash package but i does not add animations that you all knows
and also flutter_animated_splash that will also show default splash screen
Ahmad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
flutter_native_splash
replaces the mandatory still image with a different mandatory still image. You cannot do anything to make this time period longer or shorter. This image is shown while your app is loading and being prepared, and is being shown before your app starts “running” at main()
.
So no, you cannot remove this time period, but you can pick what static image to show.
You can be slick, and have an animation that starts from the static image, and then animates to some other image or series of items. You would launch that at the beginning of main()
.
1