0

I am using the package mentioned in the title, but I do not have expected results. enter image description here

As you can see, the image does not occupy all the space. and here the .yaml file

flutter_native_splash: 
  color: 00ff00
  image: assets/splash_screenrick.png

By the way, I use the color because if I delete it, it marks an error.

3
  • 1
    Does this answer your question? How can I resize image in pub package "flutter_native_splash"?
    – mikyll98
    Aug 20, 2022 at 1:24
  • should I close the question or delete it? Well, it didn't solve it for me, but from what I see, that package doesn't allow you to enlarge images.
    – mauricio
    Aug 20, 2022 at 2:07
  • 1
    actually I'm unsure about it, since apparently the thread I linked doesn't contain a concrete solution to your problem. Maybe your question will draft the attention of someone who knows how to solve it :)
    – mikyll98
    Aug 20, 2022 at 10:03

1 Answer 1

1

This should be what you are looking for:

Future<void> main() async {
  // Show splash screen for 2 seconds
  runApp(
    SizedBox(
      child: Image.asset(
        'assets/image1.jpg',
        fit: BoxFit.cover,
      ),
    ),
  );
  await Future.delayed(const Duration(seconds: 2));
  // Then, start the app
  runApp(const MyApp());
}

Without any package. This also helps for when you have a splash screen with animations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.