tabViewMaker function
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,
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();
}