import 'package:flutter/material.dart';

class SignupUserScreen extends StatefulWidget{
  const SignupUserScreen({super.key});

  @override
  State<SignupUserScreen> createState() => SignupUserScreenState();
}

class SignupUserScreenState extends State<SignupUserScreen>{
  bool passwordVisible=false;

  @override
  Widget build(BuildContext context) {
    return Column(
      spacing: 30,
      children: [
        Text("Usuario y contacto"),
        Text("Crea tu usuario", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30)),
        Text("Con tu email y tu número podremos mantenerte siempre informado"),
        TextField(decoration: InputDecoration(labelText: "Correo electrónico", hintText: "Correo electrónico", border: OutlineInputBorder())),
        Row(children: [
          DropdownMenu(
              initialSelection: "es",
              dropdownMenuEntries: List<DropdownMenuEntry>.generate(3, (int index){
                return DropdownMenuEntry(labelWidget: Icon(Icons.outlined_flag), label: "es", value: "es");
              })
          ),
          Expanded(child: TextField(
              decoration: InputDecoration(labelText: "Teléfono móvil", hintText: "Teléfono", border: OutlineInputBorder()),
              keyboardType: TextInputType.number)
          )
        ]),
        TextField(
            obscureText: passwordVisible,
            enableSuggestions: false,
            autocorrect: false,
            decoration: InputDecoration(
              labelText: "Contraseña",
              hintText: "********",
              border: OutlineInputBorder(),
              suffixIcon: IconButton(
                icon: Icon(passwordVisible
                    ? Icons.visibility
                    : Icons.visibility_off),
                onPressed: () {
                  setState(() {
                    passwordVisible = !passwordVisible;
                  });
                },
              ),
            )
        ),
        TextField(obscureText: passwordVisible,
            enableSuggestions: false,
            autocorrect: false,
            decoration: InputDecoration(
              labelText: "Repetir contraseña",
              hintText: "*******",
              border: OutlineInputBorder(),
              suffixIcon: IconButton(
                icon: Icon(passwordVisible
                    ? Icons.visibility
                    : Icons.visibility_off),
                onPressed: () {
                  setState(() {
                    passwordVisible = !passwordVisible;
                  });
                },
              ),
            )
        ),
      ],
    );
  }

}