detach method

  1. @override
void detach(
  1. ScrollPosition position, {
  2. bool fake = false,
})
override

Unregister the given position with this controller.

After this function returns, the animateTo and jumpTo methods on this controller will not manipulate the given position.

Implementation

@override
void detach(ScrollPosition position, {bool fake = false}) {
  assert(() {
//      print('{$code}:detach start {$showing}');
    return true;
  }.call());
//    if (fake) print("detach is innner");
  if (inner.positions.contains(position)) {
    inner.detach(position);
  }
  if (position == interceptedAttachPosition && !fake) {
//      print('{$code}:set null {$showing}');
    interceptedAttachPosition = null;
  }
  if (position == lastPosition && !fake) {
//      print('{$code}:set null {$showing}');
    lastPosition = null;
  }
  if (fake) {
    interceptedAttachPosition = position;
  }
  assert(() {
//      print('{$code}:detach end {$showing}');
    return true;
  }.call());
}