Closed Isa41 closed 4 months ago
Hi I have the same issue : Flutter version : 3.21.0-11.0.pre.47 screenshot version : ^2.3.0
Hi wegzwegz,I think I realised why it happens. Now flutter stable version is 3.19.3, so you dont use stable version. If you downgrade you flutter to stable version, issue will gone. Now it is working for me. Have a good code
https://github.com/ritolika/screenshot/commit/1a09fa017834f4909fbf629023179ce0a102d941
view: view,
child: RenderPositionedBox(
alignment: Alignment.center, child: repaintBoundary),
// configuration: ViewConfiguration(
// size: logicalSize,
// devicePixelRatio: pixelRatio ?? 1.0,
// ),
configuration: ViewConfiguration.fromView(view)
);```
Hi, This issue occurred because of some API Changes in Flutter.
So, We have released 2 new versions :
2.2.0 - Use this version if you are in the beta/master channel. Or if you get error
No named parameter with the name 'size'.
2.3.0 - Use this version if you are in the Stable channel. Or if you get error
No named parameter with the name 'constraints'.
@ritheshSalyan
Hi, This issue occurred because of some API Changes in Flutter.
So, We have released 2 new versions :
2.2.0 - Use this version if you are in the beta/master channel. Or if you get error
No named parameter with the name 'size'.
2.3.0 - Use this version if you are in the Stable channel. Or if you get error
No named parameter with the name 'constraints'.
Hi, I am on Channel master, 3.22.0-5.0.pre.37 and with the screenshot 2.2.0 I get the following error:
Error: No named parameter with the name 'constraints'.
If I use 2.3.0 I get:
No named parameter with the name 'size'.
So, both options don't work for me.
For me i solved the issue by changing the already mentioned code to this. Worked for me on Flutter (Channel master, 3.22.0-16.0.pre.57) Here is my Reference: https://github.com/flutter/flutter/issues/141562#issuecomment-1894740176
final RenderView renderView = RenderView(
view: view,
child: RenderPositionedBox(
alignment: Alignment.center, child: repaintBoundary),
configuration: ViewConfiguration(
physicalConstraints: BoxConstraints.tight(logicalSize) * (pixelRatio ?? 1.0),
logicalConstraints: BoxConstraints.tight(logicalSize),
devicePixelRatio: pixelRatio ?? 1.0,
),
);
Hi @ritheshSalyan! Any news? The issue still persist in the beta/master channel at the moment and it seems that the Flutter team will not change his decision on this breaking change. We need a fix for this on your side, no?
Hi @all,
We have Pushed a commit to work with master channel. Please Use the latest commit from git.
screenshot:
git:
url: https://github.com/SachinGanesh/screenshot.git
@ritheshSalyan Awesome thanks! I'll try it tomorrow. And when will you release a new screenshot's package pub.dev version with this fix?
? New flutter 3.22 now fails. Why taking so long to update?
@ritheshSalyan github solution works under Flutter 3.22.0 • channel stable
Hi @All , We have published latest version screenshot: ^3.0.0
to pub.dev.
I have taken this error for 2 days. How can I handle this issue. Anyone help ?
Error (Xcode): ../../../.pub-cache/hosted/pub.dev/screenshot-2.3.0/lib/screenshot.dart:164:9: Error: No named parameter with the name 'size'.
Could not build the application for the simulator. ::: No named parameter with the name 'size'.