myVTab static method

Tab myVTab(
  1. String title,
  2. bool isCurrent,
  3. BuildContext context, {
  4. Color indicatorColor = UIData.primaryColor,
  5. Color titleNColor = UIData.black,
  6. num indicatorH = 100,
  7. num indicatorW = 8,
})

Implementation

static Tab myVTab(String title, bool isCurrent, BuildContext context,
    {Color indicatorColor = UIData.primaryColor,
    Color titleNColor = UIData.black,
    num indicatorH = 100,
    num indicatorW = 8}) {
  var isZhg = true;

  var textWidget = Text(
    title,
    maxLines: 2,
    overflow: TextOverflow.ellipsis,
    style: TextStyle(
        fontSize: 12.0,
        color: isZhg && isCurrent
            ? UIData.pureWhite
            : isCurrent
                ? indicatorColor
                : titleNColor),
  );

  return Tab(
    child: Stack(
      children: [
        !isCurrent
            ? SizedBox()
            : Row(
                children: [
                  Expanded(
                      child: MyAssetImageView(
                    'ic_shop_cate_zhg_bg.png',
                    width: 86.hsp,
                    fit: BoxFit.fill,
                  )
                          .box
                          .color(Colors.transparent)
                          .padding(EdgeInsets.fromLTRB(2.0, .0, 2.0, 0.0))
                          .make())
                ],
              ),
        Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            isZhg && isCurrent
                ? SizedBox()
                : Container(
                    margin: EdgeInsets.fromLTRB(0.0, 0.0, 8.0, 0.0),
                    decoration: isCurrent
                        ? BoxDecoration(color: indicatorColor)
                        : null,
                    width: indicatorW.toDouble(),
                    height: indicatorH.toDouble(),
                  ),
            Expanded(
                child: Container(
              child: isZhg ? textWidget.centered() : textWidget,
            )),
          ],
        )
      ],
    ).box.height(isZhg && isCurrent ? 48.vsp : double.infinity).make(),
  );
}