Beispiel #1
0
        public override bool shouldRepaint(CustomPainter old)
        {
            _IndicatorPainter _old = (_IndicatorPainter)old;

            return(this._needsPaint ||
                   this.controller != _old.controller ||
                   this.indicator != _old.indicator ||
                   this.tabKeys.Count != _old.tabKeys.Count ||
                   !_tabOffsetsEqual(this._currentTabOffsets, _old._currentTabOffsets));
        }
Beispiel #2
0
 void _initIndicatorPainter()
 {
     this._indicatorPainter = this._controller == null
         ? null
         : new _IndicatorPainter(
         controller: this._controller,
         indicator: this._indicator,
         indicatorSize: this.widget.indicatorSize ?? TabBarTheme.of(this.context).indicatorSize,
         tabKeys: this._tabKeys,
         old: this._indicatorPainter
         );
 }
Beispiel #3
0
 public _IndicatorPainter(
     TabController controller          = null,
     Decoration indicator              = null,
     TabBarIndicatorSize?indicatorSize = null,
     List <GlobalKey> tabKeys          = null,
     _IndicatorPainter old             = null
     ) : base(repaint: controller.animation)
 {
     D.assert(controller != null);
     D.assert(indicator != null);
     this.controller    = controller;
     this.indicator     = indicator;
     this.indicatorSize = indicatorSize;
     this.tabKeys       = tabKeys;
     if (old != null)
     {
         this.saveTabOffsets(old._currentTabOffsets);
     }
 }