LastMonopoly / scaled_app

Scale the entire UI design proportionally, useful when your UI design is fixed-width.
https://pub.dev/packages/scaled_app
BSD 3-Clause "New" or "Revised" License
20 stars 8 forks source link

flutter beta branch build failed #15

Open selvam920 opened 12 months ago

selvam920 commented 12 months ago

The named parameter 'size' isn't defined. Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'size'.

bajajbros commented 11 months ago

Hey did you find any solution or alternative package?

selvam920 commented 8 months ago

no

techvx commented 7 months ago

Take a look here and here, or simply replace the following in the ScaledWidgetsFlutterBinding:

  @override
  ViewConfiguration createViewConfigurationFor(RenderView renderView) {
    final FlutterView view = platformDispatcher.implicitView!;
    final devicePixelRatio = view.devicePixelRatio;
    final physicalSize = view.physicalSize;

    if (physicalSize.isEmpty) {
      return super.createViewConfigurationFor(renderView);
    } else {
      devicePixelRatioScaled = devicePixelRatio * scale;
      return ViewConfiguration(
        physicalConstraints: BoxConstraints.fromViewConstraints(view.physicalConstraints),
        logicalConstraints: BoxConstraints.tight(physicalSize) / devicePixelRatioScaled,
        // size: logicalSize /* - is no longer a valid API, use the two lines above ^ */
        devicePixelRatio: devicePixelRatioScaled,
      );
    }
  }