mirrored_repositories/Pretty-Ui/Eden/lib/features/onboarding/screens
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:smooth_page_indicator/smooth_page_indicator.dart';

import '../../../../core/utils/app_colors.dart';

class CustomIndicator extends StatelessWidget {
  final PageController controller;
  final int dotsLength;
  final double? height;
  final double? width;
  const CustomIndicator({
    required this.controller,
    required this.dotsLength,
    this.height,
    this.width,
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    bool isDarkMode(BuildContext context) =>
        Theme.of(context).brightness == Brightness.dark;

    return SmoothPageIndicator(
      controller: controller,
      count: dotsLength,
      onDotClicked: (index) {},
      effect: SlideEffect(
        dotColor: isDarkMode(context)
            ? AppColors.kWhite
            : AppColors.kSecondary.withOpacity(0.3),
        activeDotColor:
            isDarkMode(context) ? AppColors.kPrimary : AppColors.kSecondary,
        dotHeight: height ?? 8.h,
        dotWidth: width ?? 8.w,
      ),
    );
  }
}
