lineIndicator function

Widget lineIndicator({
  1. int? slideIndex = 0,
  2. int? index = 0,
  3. Color? activeColor = const Color(0xff2455EF),
  4. Color? unactiveColor = const Color(0xffBDCCFA),
})

Implementation

Widget lineIndicator({
  int? slideIndex = 0,
  int? index = 0,
  Color? activeColor = const Color(0xff2455EF),
  Color? unactiveColor = const Color(0xffBDCCFA),
}) {
  return Expanded(
    child: Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        Expanded(
          flex: 3,
          child: Container(
            margin: const EdgeInsets.only(left: 0.0, right: 0.0, bottom: 5.0),
            height: 2.0,
            decoration: BoxDecoration(
              color: index! <= slideIndex! ? activeColor : unactiveColor,
            ),
          ),
        ),
      ],
    ),
  );
}