import 'package:auth/src/device_sign_up/add_kid_screen.dart';
import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

class AccountCreatedScreen extends ConsumerWidget {
  const AccountCreatedScreen({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final theme = ref.watch(themePortProvider);

    final email = "usuario@example.com";
    final fullName = "Carlos Pérez Cruz";

    return Scaffold(
      backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
      body: Container(
        margin: EdgeInsets.all(30),
        child: Center(
          child: Column(
            spacing: 20,
            children: [
              Spacer(flex: 10),
              Icon(
                Icons.check,
                color: theme.getColorFor(ThemeCode.backgroundPrimary),
                size: 50,
              ),
              Text(
                "Cuenta creada",
                style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold),
              ),
              Text.rich(
                TextSpan(
                  text: "Has creado la cuenta para:\n",
                  children: [
                    TextSpan(
                      text: fullName,
                      style: TextStyle(fontWeight: FontWeight.bold),
                    ),
                  ],
                ),
              ),
              Text.rich(
                TextSpan(
                  text: "Hemos enviado un email de verificación a:\n",
                  children: [
                    TextSpan(
                      text: email,
                      style: TextStyle(fontWeight: FontWeight.bold),
                    ),
                  ],
                ),
              ),
              Text(
                "Crea la cuenta de tu peque e ingresa su \nprimera paga para utilizarla con su reloj",
              ),
              FilledButton(
                onPressed: () => {
                  Navigator.pushReplacement(
                    context,
                    MaterialPageRoute(builder: (_) => AddKidScreen()),
                  ),
                },
                child: Text("Continuar"),
              ),
              Spacer(flex: 8),
            ],
          ),
        ),
      ),
    );
  }
}
