Advertisement
ZergRushA

zadanie flutter

Oct 19th, 2024 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'login_screen.dart';
  3.  
  4. class SplashScreen extends StatefulWidget {
  5. const SplashScreen({Key? key}) : super(key: key);
  6.  
  7. @override
  8. _SplashScreenState createState() => _SplashScreenState();
  9. }
  10.  
  11. class _SplashScreenState extends State<SplashScreen> with SingleTickerProviderStateMixin {
  12. late AnimationController _controller;
  13.  
  14. @override
  15. void initState() {
  16. super.initState();
  17. _controller = AnimationController(
  18. duration: const Duration(seconds: 3),
  19. vsync: this,
  20. )..forward();
  21.  
  22. Future.delayed(const Duration(seconds: 3), () {
  23. Navigator.of(context).pushReplacement(
  24. MaterialPageRoute(builder: (context) => const LoginScreen()),
  25. );
  26. });
  27. }
  28.  
  29. @override
  30. void dispose() {
  31. _controller.dispose();
  32. super.dispose();
  33. }
  34.  
  35. @override
  36. Widget build(BuildContext context) {
  37. return Scaffold(
  38. body: Center(
  39. child: FadeTransition(
  40. opacity: _controller,
  41. child: const Text(
  42. 'Always on Sport',
  43. style: TextStyle(fontSize: 32, fontWeight: FontWeight.bold),
  44. ),
  45. ),
  46. ),
  47. );
  48. }
  49. }
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement