import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

import 'login_page.dart';

class SessionPage extends StatelessWidget {
  final String fcmToken;

  const SessionPage({Key? key, required this.fcmToken}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final _screenSize = MediaQuery.of(context).size;
    return Scaffold(
      body: Container(
        height: _screenSize.height,
        width: _screenSize.width,
        decoration: const BoxDecoration(
          image: DecorationImage(image: AssetImage('assets/sesion.png'), fit: BoxFit.cover),
        ),
        child: SafeArea(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Image.asset(
                'assets/lol0.png',
                width: _screenSize.width - 64.0,
              ),
              const SizedBox(
                height: 24.0,
              ),
              SizedBox(
                width: _screenSize.width-64.0,
                child: Text(
                  '¿Desea mantener su sesión activa en este dispositivo por 30 días?',
                  style: GoogleFonts.montserrat(
                    fontWeight: FontWeight.bold,
                    fontSize: 20.0,
                    color: const Color.fromRGBO(22, 23, 112, 1),
                  ),
                  textAlign: TextAlign.center,
                ),
              ),
              const SizedBox(
                height: 24.0,
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: <Widget>[
                  Column(
                    children: <Widget>[
                      ButtonTheme(
                        minWidth: 0.0,
                        height: 0,
                        child: ElevatedButton(
                          style: ElevatedButton.styleFrom(
                              padding: const EdgeInsets.symmetric(horizontal: 0.0),
                              shape: RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(100.0)
                              ),
                              primary: Colors.transparent,
                              elevation: 0.0
                          ),
                          child: const Image(image: AssetImage('assets/lo0.png'),width: 57.5, height: 57.5),
                          onPressed: () => Navigator.pushReplacement(context, MaterialPageRoute(
                              builder: (context) => LoginPage(
                                fcmToken: fcmToken,
                                rememberSession: true,
                              )
                          )),
                        ),
                      ),
                      const SizedBox(height: 12.0),
                      Text('SI', style: GoogleFonts.montserrat(color: const Color.fromRGBO(150,150,150, 1.0), fontWeight: FontWeight.w600, fontSize: 18.0))
                    ],
                  ),
                  SizedBox(width: _screenSize.width*0.3),
                  Column(
                    children: <Widget>[
                      ButtonTheme(
                        minWidth: 0.0,
                        height: 0,
                        child: ElevatedButton(
                          style: ElevatedButton.styleFrom(
                              padding: EdgeInsets.symmetric(horizontal: 0.0),
                              shape: RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(100.0)
                              ),
                              primary: Colors.transparent,
                              elevation: 0.0
                          ),
                          child: const Image(image: AssetImage('assets/lolo0.png'),width: 57.5, height: 57.5),
                          onPressed: () => Navigator.pushReplacement(context, MaterialPageRoute(
                              builder: (context) => LoginPage(
                                fcmToken: fcmToken,
                                rememberSession: false,
                              )
                          )),
                        ),
                      ),
                      const SizedBox(height: 12.0),
                      Text('NO', style: GoogleFonts.montserrat(color: const Color.fromRGBO(150,150,150, 1.0), fontWeight: FontWeight.w600, fontSize: 18.0))
                    ],
                  ),
                ],
              )
            ],
          ),
        ),
      ),
    );
  }
}
