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

class ErrorPage extends StatelessWidget {
  final String strError;

  const ErrorPage({
    Key? key,
    required this.strError
  }) : 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/background.png"),
            fit: BoxFit.cover,
          ),
        ),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Image.asset(
              "assets/warning.png",
              fit: BoxFit.fill,
              width: 64.0,
            ),
            Container(
              padding: const EdgeInsets.symmetric(
                horizontal: 16.0,
              ),
              margin: const EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 16.0),
              child: Text(
                "¡ERROR!",
                textAlign: TextAlign.center,
                style: GoogleFonts.montserrat(
                  color: Colors.redAccent,
                  fontSize: 24.0,
                  fontWeight: FontWeight.bold,
                ),
              ),
            ),
            Container(
              padding: const EdgeInsets.symmetric(
                horizontal: 16.0,
              ),
              margin: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 16.0),
              child: Text(
                "Lamentamos el inconveniente, se ha producido el siguiente error: \n\n$strError\n\nPor favor "
                    "contacte al departamento de TI de ITTEC o a su proveedor del servicio de Plataforma Educativa.",
                textAlign: TextAlign.center,
                style: GoogleFonts.montserrat(
                  fontSize: 18.0,
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
