Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- import 'login_screen.dart';
- class SplashScreen extends StatefulWidget {
- const SplashScreen({Key? key}) : super(key: key);
- @override
- _SplashScreenState createState() => _SplashScreenState();
- }
- class _SplashScreenState extends State<SplashScreen> with SingleTickerProviderStateMixin {
- late AnimationController _controller;
- @override
- void initState() {
- super.initState();
- _controller = AnimationController(
- duration: const Duration(seconds: 3),
- vsync: this,
- )..forward();
- Future.delayed(const Duration(seconds: 3), () {
- Navigator.of(context).pushReplacement(
- MaterialPageRoute(builder: (context) => const LoginScreen()),
- );
- });
- }
- @override
- void dispose() {
- _controller.dispose();
- super.dispose();
- }
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Center(
- child: FadeTransition(
- opacity: _controller,
- child: const Text(
- 'Always on Sport',
- style: TextStyle(fontSize: 32, fontWeight: FontWeight.bold),
- ),
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement