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

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

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

    final model = "SaveWatch Plus 2";
    final id = "1106652524";
    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: 2),
              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("Reloj: $model"),
              Text("ID del reloj: $id"),
              Text(
                "Ya puedes darle su primera paga paa que empiece a disfrutarla en su reloj",
                style: TextStyle(fontWeight: FontWeight.bold),
              ),
              Spacer(flex: 6),
              Container(
                padding: EdgeInsets.all(20),
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.only(
                    topRight: Radius.circular(20),
                    topLeft: Radius.circular(20),
                  ),
                ),
                child: Column(
                  children: [
                    Expanded(
                      child: FilledButton(
                        onPressed: () => {
                          Navigator.pushReplacement(
                            context,
                            MaterialPageRoute(builder: (_) => AddKidScreen()),
                          ),
                        },
                        child: Text("Dale su primera paga"),
                      ),
                    ),
                    TextButton(
                      onPressed: () => {},
                      child: Text("Añadir otro peque"),
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
