 import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

class SignupAddressScreen extends ConsumerStatefulWidget {
  const SignupAddressScreen({super.key});

  @override
  ConsumerState<SignupAddressScreen> createState() => SignupAddressScreenState();

}

class SignupAddressScreenState extends ConsumerState<SignupAddressScreen>{

  late String country;
  late int relation;

  @override
  void initState() {
    relation = 0;
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      spacing: 24,
      children: [
        Column(
          spacing: 8,
          children: [
            Align(alignment: Alignment.bottomLeft, child: Text(
              "Fecha de nacimiento",
              style: TextStyle(fontSize: 14, letterSpacing: 0),
            )),
            Row(
                spacing: 8,
                children: [
                  Expanded(child: CustomTextField(
                    //label: "Fecha de nacimiento",
                    hint: "DD",
                    length: 2,
                    numeric: true,
                  )),
                  Expanded(child: CustomTextField(
                    hint: "MM",
                    length: 2,
                    numeric: true,
                  )),
                  Expanded(child: CustomTextField(
                    hint: "AAAA",
                    length: 4,
                    numeric: true,
                  )),
                ]
            ),
          ],
        ),
        Column(
          spacing: 8,
          children: [
            Align(
              alignment: Alignment.bottomLeft,
              child: Text(
                "¿Qué familiar eres?",
                style: TextStyle(fontSize: 14, letterSpacing: 0),
              ),
            ),
            CustomDropdown(
              items: [Text("Padre"), Text("Madre"), Text("Tutor")],
              hint: "¿Qué familiar eres?",
              onChanged: (value)=>setState(() {
                relation = value;
              })
            ),
          ],
        ),
        CustomTextField(label: "Dirección completa", hint: "Calle Gran Vía 30 6º, 28013"),
        CustomTextField(label: "Ciudad", hint: "Ciudad"),
        Column(
          spacing: 8,
          children: [
            Align(
              alignment: Alignment.bottomLeft,
              child: Text(
                "País",
                style: TextStyle(fontSize: 14, letterSpacing: 0),
              ),
            ),
            CustomDropdown(
              items: [Text("España"), Text("Francia"), Text("Portugal")],
              hint: "País",
              onChanged: (value)=>setState(() {
                country = value;
              })
            ),
          ],
        ),
        CustomTextField(label: "Nacionalidad", hint: "España"),
      ],
    );
  }
}
