shouldRebuild method

  1. @override
bool shouldRebuild(
  1. covariant SliverChildListDelegate oldDelegate

Called whenever a new instance of the child delegate class is provided to the sliver.

If the new instance represents different information than the old instance, then the method should return true, otherwise it should return false.

If the method returns false, then the build call might be optimized away.


bool shouldRebuild(covariant SliverChildListDelegate oldDelegate) {
  return children != oldDelegate.children;