import 'package:english_learning/core/utils/styles/theme.dart';
import 'package:flutter/material.dart';

class SliderWidget extends StatelessWidget {
  final int currentPage;
  final int itemCount;

  const SliderWidget({
    super.key,
    required this.currentPage,
    required this.itemCount,
  });

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: List.generate(
        itemCount,
        (index) => AnimatedContainer(
          duration: const Duration(milliseconds: 300),
          margin: const EdgeInsets.symmetric(horizontal: 4.0),
          height: 8,
          width: currentPage == index ? 24 : 8,
          decoration: BoxDecoration(
            gradient: currentPage == index
                ? AppColors.gradientTheme
                : const LinearGradient(
                    colors: [
                      AppColors.sliderInActive,
                      AppColors.sliderInActive,
                    ],
                  ),
            borderRadius: BorderRadius.circular(12),
          ),
        ),
      ),
    );
  }
}
