tabViewMaker function

Widget tabViewMaker(
  1. String title,
  2. double width, {
  3. bool isCurrent = false,
  4. double? titleSize,
  5. double? titleHiSize,
  6. double? height,
  7. double? indicatorW,
  8. double? indicatorH,
  9. bool isTitleBold = false,
  10. bool isBottomLine = false,
  11. Color? hiTitleColor,
  12. Color lineColor = const Color(0xff8BD9FE),
  13. Color normalColor = const Color(0xff676869),
  14. Color hiColor = Colors.cyan,
})

Implementation

Widget tabViewMaker(String title, double width,
    {bool isCurrent = false,
    double? titleSize,
    double? titleHiSize,
    double? height,
    double? indicatorW,
    double? indicatorH,
    bool isTitleBold = false,
    bool isBottomLine = false,
    Color? hiTitleColor,
    Color lineColor = const Color(0xff8BD9FE),
    Color normalColor = const Color(0xff676869),
    Color hiColor = Colors.cyan}) {
  var iH = indicatorH ?? 2.vsp;
  var textColor = ((isCurrent)
      ? hiTitleColor != null
          ? hiTitleColor
          : !isTitleBold
              ? hiColor
              : hiColor
      : normalColor);
  return VStack(
    [
      Flexible(
          child: Text(
        title,
        style: TextStyle(
            color: textColor,
            fontSize: (isCurrent ? titleHiSize : titleSize) ?? 18.fsp,
            fontWeight: isTitleBold
                ? (isCurrent ? FontWeight.w600 : FontWeight.normal)
                : FontWeight.normal),
      ).centered()),
      Container(
        height: indicatorH ?? 2.vsp,
        decoration: ShapeDecoration(
            color: isCurrent ? hiColor : Colors.transparent,
            shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(iH)))),
        width: indicatorW ?? 120.hsp,
      ),
      isBottomLine
          ? Container(
              color: lineColor,
              height: 0.5.vsp,
              width: width,
            )
          : SizedBox(
              height: 0.5.vsp,
            ),
    ],
    crossAlignment: CrossAxisAlignment.center,
  )
      .box
      .size(width, height ?? 40.vsp)
      .make()
      .animatedBox
      .milliSeconds(milliSec: 300)
      .easeIn
      .make();
}