update method

  1. @override
void update(
  1. covariant SliverPinnedPersistentHeaderRenderObjectWidget newWidget
)
override

Change the widget used to configure this element.

The framework calls this function when the parent wishes to use a different widget to configure this element. The new widget is guaranteed to have the same runtimeType as the old widget.

This function is called only during the "active" lifecycle state.

Implementation

@override
void update(SliverPinnedPersistentHeaderRenderObjectWidget newWidget) {
  final SliverPinnedPersistentHeaderRenderObjectWidget oldWidget = widget;
  super.update(newWidget);
  final SliverPinnedPersistentHeaderDelegate newDelegate = newWidget.delegate;
  final SliverPinnedPersistentHeaderDelegate oldDelegate = oldWidget.delegate;
  if (newDelegate != oldDelegate &&
      (newDelegate.runtimeType != oldDelegate.runtimeType ||
          newDelegate.shouldRebuild(oldDelegate))) {
    renderObject.triggerRebuild();
  }
  _minExtentPrototype = updateChild(_minExtentPrototype,
      widget.delegate.minExtentProtoType, _minExtentPrototypeSlot);
  _maxExtentPrototype = updateChild(_maxExtentPrototype,
      widget.delegate.maxExtentProtoType, _maxExtentPrototypeSlot);
}