import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:navigation/navigation.dart';

class WelcomeScreen extends ConsumerWidget {
  final NavigationContract navigationContract;

  const WelcomeScreen({super.key, required this.navigationContract});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    return Scaffold(
      body: Center(
        child: Column(
          children: [
            Spacer(),
            Expanded(
              child: CarouselView(
                scrollDirection: Axis.horizontal,
                itemExtent: double.infinity,
                itemSnapping: true,
                shrinkExtent: 400,
                children: generateSteps(),
              ),
            ),
            FilledButton(
              onPressed: () => navigationContract.goTo(AppRoutes.linkPhone),
              child: const Text('Continuar'),
            ),
            Spacer(),
          ],
        ),
      ),
    );
  }

  void jumpToNext(BuildContext context) {
    // Navigator.pushReplacement(
    //   context,
    //   MaterialPageRoute(builder: (_) => LinkPhoneScreen()),
    // );
    return;
  }

  List<Widget> generateSteps() {
    return [
      Column(
        spacing: 30,
        children: [
          SvgPicture.asset("assets/images/ui/bienvenida_paso1.svg"),
          Text(
            "Aprende a gestionar su dinero",
            style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
          ),
          Text("Tu peque crea hábitos y se divierte mientras lo hace"),
        ],
      ),
      Column(
        children: [
          SvgPicture.asset("assets/images/ui/bienvenida_paso2.svg"),
          Text("Tranquilidad en cada pago que hacen"),
          Text("Supervisa gastos, fija límites y acompáñalos en cada paso"),
        ],
      ),
      Column(
        children: [
          SvgPicture.asset("assets/images/ui/bienvenida_paso3.svg"),
          Text("Pagos fáciles y seguros en sus manos"),
          Text("Podrá pagar desde su reloj.\n Sin móvil ni efectivo"),
        ],
      ),
    ];
  }
}
