Home > other >  Flutter(Android) splash screen with two logos
Flutter(Android) splash screen with two logos

Time:08-04

I would like to create a splash screen for an application created with flutter. I already have tried the enter image description here

I know that I can create the whole Image as splash screen but I don't see it as the most proper way to do it.

Are there any ideas?

CodePudding user response:

Try this

Stack(
      children: [
        Container(
          height: MediaQuery.of(context).size.height,
          width: MediaQuery.of(context).size.width,
          child: //background image,
        ),
        Align(
          alignment: Alignment.center,
          child: //first logo,
        ),
        Positioned(
          left: 0,
          right: 0,
          bottom: 50.0,
          child: //second logo,
        )
      ],
    )

CodePudding user response:

Splash screen is naturally implemented in native side, so the modifications will be done there too.

iOS / Apple

All apps submitted to the Apple App Store must use an Xcode storyboard to provide the app’s launch screen.

Android

The default Flutter project template includes a definition of a launch theme and a launch background. You can customize this by editing xml.

See Adding a splash screen to your mobile app for details.

CodePudding user response:

you can create your splash screen easily like this withOut any packages

    import 'package:flutter/material.dart';
    import 'package:hive_flutter/hive_flutter.dart';
    
    class WelcomePage extends StatefulWidget {
      const WelcomePage({Key? key}) : super(key: key);
    
      @override
      State<WelcomePage> createState() => _WelcomePageState();
    }
    
    class _WelcomePageState extends State<WelcomePage> {
      @override
      void initState() {

       //here the delayed time is 3 seconds you can edit it 
      
        Future.delayed(const Duration(seconds: 3), () {

       // after that the user will be automatically redirected to the Home S 
       //Screen
       
            runApp(const MaterialApp(home: Home()));
          
        });
        super.initState();
      }
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          body: Column(
            children: [

            // here put your widget as normal as possible 
            //  your logo and your text 
             
            ],
          ),
        );
      }
    }
  • Related