import 'dart:async'; import 'package:flutter/material.dart'; import 'package:my_flutter_puzzle/screens/level_list/screen/level_list_screen.dart'; import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart'; class SplashScreen extends StatefulWidget { const SplashScreen({Key? key}) : super(key: key); @override State createState() => _SplashScreenState(); } class _SplashScreenState extends State { @override void initState() { Timer(const Duration(milliseconds: 2000), () { Navigator.push(context, MaterialPageRoute( builder: (context) { return const LevelListScreen(); }, )); }); super.initState(); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: const Color(0xff6236FF), body: Center( child: Container( decoration: BoxDecoration( image: DecorationImage( image: AssetImage('splash_screen_image'.pngPath), ), ), ), ), ); } }