offset property Null safety

double offset

The difference between the animation's value and index.

The offset value must be between -1.0 and 1.0.

This property is typically set by the TabBarView when the user drags left or right. A value between -1.0 and 0.0 implies that the TabBarView has been dragged to the left. Similarly a value between 0.0 and 1.0 implies that the TabBarView has been dragged to the right.

Implementation

double get offset => _animationController!.value - _index.toDouble();
void offset=(double value)

Implementation

set offset(double value) {
  assert(value != null);
  assert(value >= -1.0 && value <= 1.0);
  assert(!indexIsChanging);
  if (value == offset)
    return;
  _animationController!.value = value + _index.toDouble();
}