在tabBar_indicator类中修改
Rect _indicatorRectFor(Rect rect, TextDirection textDirection) {
assert(rect !=null);
assert(textDirection !=null);
final Rect indicator =insets.resolve(textDirection).deflateRect(rect);
//希望的宽度
double wantWidth =20;
//取中间坐标
double cw = (indicator.left + indicator.right) /2;
return Rect.fromLTWH(cw - wantWidth /2,
indicator.bottom -borderSide.width-11, wantWidth,borderSide.width);
// return Rect.fromLTWH(
// indicator.left,
// indicator.bottom - borderSide.width,
// indicator.width,
// borderSide.width,
// );
网友评论