- override
Whether LazyBlock should evict its cache of widgets returned by buildItem.
When a LazyBlock receives a new configuration with a new delegate, it
evicts its cache of widgets if (1) the new configuration has a delegate
with a different runtimeType than the old delegate, or (2) the
shouldRebuild method of the new delegate returns true when passed the
old delgate.
When calling this function, LazyBlock will always pass an argument that
matches the runtimeType of the receiver.
Source
@override
bool shouldRebuild(LazyBlockChildren oldDelegate) {
return children != oldDelegate.children;
}