recommendDeferredLoading method Null safety

bool recommendDeferredLoading(
  1. BuildContext context
)

Provides a heuristic to determine if expensive frame-bound tasks should be deferred.

The actual work of this is delegated to the physics via ScrollPhysics.recommendDeferredLoading called with the current activity's ScrollActivity.velocity.

Returning true from this method indicates that the ScrollPhysics evaluate the current scroll velocity to be great enough that expensive operations impacting the UI should be deferred.

Implementation

bool recommendDeferredLoading(BuildContext context) {
  assert(context != null);
  assert(activity != null);
  assert(activity!.velocity != null);
  assert(_impliedVelocity != null);
  return physics.recommendDeferredLoading(
    activity!.velocity + _impliedVelocity,
    copyWith(),
    context,
  );
}