android – Easy methods to create splash display screen in flutter?


positive i create simply demo for instance .

do this code as you informed i add 3 second time restrict and icon and textual content for easy ui.

import 'dart:async';

import 'package deal:flutter/materials.dart';
import 'package deal:flutter/companies.dart';

import 'home_page_demo.dart';

class SplashScreenDemo extends StatefulWidget {
const SplashScreenDemo({tremendous.key});

@override
State<SplashScreenDemo> createState() => _SplashScreenDemoState();
}

class _SplashScreenDemoState extends State<SplashScreenDemo> {
@override
void initState() {
tremendous.initState();
Timer(const Period(seconds: 3), () { // if you need improve time 
  Navigator.pushReplacement(context,
      MaterialPageRoute(builder: (context) => const HomePageDemo())); // change with your house display screen
});
}

@override
Widget construct(BuildContext context) {
 return AnnotatedRegion(
  worth: const SystemUiOverlayStyle(statusBarColor: Colours.clear),
  little one: Scaffold(
    backgroundColor: Colours.deepPurpleAccent,
    physique: SizedBox(
      top: MediaQuery.of(context).dimension.top,
      width: MediaQuery.of(context).dimension.width,
      little one: const Column(
        crossAxisAlignment: CrossAxisAlignment.middle,
        mainAxisAlignment: MainAxisAlignment.middle,
        kids: [
          Spacer(),
          Icon(
            Icons.fastfood,
            color: Colors.white,
            size: 80,
          ),
          Spacer(),
          SafeArea(
              bottom: true,
              child: Text(
                "Your App Name",
                style: TextStyle(fontSize: 22, color: Colors.white),
              ))
        ],
      ),
    ),
  ),
);
}
}

enter image description here

enter image description here

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles