import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:tacban/src/app/auth/screens/login.dart';

class SlapshScreen extends ConsumerStatefulWidget {
  static String path = '/';
  const SlapshScreen({ Key? key }) : super(key: key);

  @override
  ConsumerState<SlapshScreen> createState() => _SlapshScreenState();
}

class _SlapshScreenState extends ConsumerState<SlapshScreen> {
  final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
  bool showpass = false;
  TextEditingController emailController = TextEditingController();
  TextEditingController senhaController = TextEditingController();
  
  @override
  void initState() {
    Future.delayed(const Duration(seconds: 3)).then((value)async{
      context.go(LoginScreen.path);
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      key: _scaffoldKey,
      backgroundColor: Theme.of(context).primaryColor,
      body: Container(
        decoration: const BoxDecoration(
          image: DecorationImage(
            image: AssetImage('lib/assets/images/bg_header.png'),
            fit: BoxFit.cover,
          )
        ),
        width: MediaQuery.of(context).size.width,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                SizedBox(
                  child: Image.asset(
                    'lib/assets/logos/logo_branca.png',
                    width: 200,
                    fit: BoxFit.fill
                  )
                ),
              ]
            )
          ],
        ),
      ),
    );
  }
}