ViewConfiguration.fromView constructor

ViewConfiguration.fromView(
  1. FlutterView view
)

Creates a view configuration for the provided FlutterView.

Implementation

factory ViewConfiguration.fromView(ui.FlutterView view) {
  final BoxConstraints physicalConstraints = BoxConstraints.fromViewConstraints(view.physicalConstraints);
  final double devicePixelRatio = view.devicePixelRatio;
  return ViewConfiguration(
    physicalConstraints: physicalConstraints,
    logicalConstraints: physicalConstraints / devicePixelRatio,
    devicePixelRatio: devicePixelRatio,
  );
}