You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

  1. import 'dart:async';
  2. import 'package:flutter/material.dart';
  3. import 'package:my_flutter_puzzle/screens/level_list/screen/level_list_screen.dart';
  4. import 'package:my_flutter_puzzle/utils/extensions/string_extensions.dart';
  5. class SplashScreen extends StatefulWidget {
  6. const SplashScreen({Key? key}) : super(key: key);
  7. @override
  8. State<SplashScreen> createState() => _SplashScreenState();
  9. }
  10. class _SplashScreenState extends State<SplashScreen> {
  11. @override
  12. void initState() {
  13. Timer(const Duration(milliseconds: 2000), () {
  14. Navigator.push(context, MaterialPageRoute(
  15. builder: (context) {
  16. return const LevelListScreen();
  17. },
  18. ));
  19. });
  20. super.initState();
  21. }
  22. @override
  23. Widget build(BuildContext context) {
  24. return Scaffold(
  25. backgroundColor: const Color(0xff6236FF),
  26. body: Center(
  27. child: Container(
  28. decoration: BoxDecoration(
  29. image: DecorationImage(
  30. image: AssetImage('splash_screen_image'.pngPath),
  31. ),
  32. ),
  33. ),
  34. ),
  35. );
  36. }
  37. }