shouldUpdateMatrix method

bool shouldUpdateMatrix(
  1. ViewConfiguration oldConfiguration
)

Returns whether toMatrix would return a different value for this configuration than it would for the given oldConfiguration.

Implementation

bool shouldUpdateMatrix(ViewConfiguration oldConfiguration) {
  if (oldConfiguration.runtimeType != runtimeType) {
    // New configuration could have different logic, so we don't know
    // whether it will need a new transform. Return a conservative result.
    return true;
  }
  // For this class, the only input to toMatrix is the device pixel ratio,
  // so we return true if they differ and false otherwise.
  return oldConfiguration.devicePixelRatio != devicePixelRatio;
}