Flutter修改Indicator 位置和大小

2022-02-17  本文已影响0人  东风不起尘

在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,

  // );

上一篇 下一篇

猜你喜欢

热点阅读