configuration property

ViewConfiguration configuration

The constraints used for the root layout.

Typically, this configuration is set by the RendererBinding, when the RenderView is registered with it. It will also update the configuration if necessary. Therefore, if used in conjunction with the RendererBinding this property must not be set manually as the RendererBinding will just override it.

For tests that want to change the size of the view, set TestFlutterView.physicalSize on the appropriate TestFlutterView (typically WidgetTester.view) instead of setting a configuration directly on the RenderView.

A configuration must be set (either directly or by passing one to the constructor) before calling prepareInitialFrame.

Implementation

ViewConfiguration get configuration => _configuration!;
void configuration=(ViewConfiguration value)

Implementation

set configuration(ViewConfiguration value) {
  if (_configuration == value) {
    return;
  }
  final ViewConfiguration? oldConfiguration = _configuration;
  _configuration = value;
  if (_rootTransform == null) {
    // [prepareInitialFrame] has not been called yet, nothing more to do for now.
    return;
  }
  if (oldConfiguration == null || configuration.shouldUpdateMatrix(oldConfiguration)) {
    replaceRootLayer(_updateMatricesAndCreateNewRootLayer());
  }
  assert(_rootTransform != null);
  markNeedsLayout();
}