2

I'm using screenshot: 2.0.0 and I'm getting this error when I try to build my project.

: Error: Undefined name 'View'.
screenshot.dart:154
        context == null ? fallBackView : View.maybeOf(context) ?? fallBackView;
                                         ^^^^
: Error: No named parameter with the name 'view'.
screenshot.dart:164
      view: view,
      ^^^^
: Context: Found this candidate, but the arguments don't match.
view.dart:68
  RenderView({
  ^^^^^^^^^^

I tried to upgrade to screenshot:2.1.0 but it's available only for Flutter SDK >= 3.10.0 and I'm currently working on a production app so I can't change to master channel.

2 Answers2

1

I upgrade my Flutter SDK with the latest version.

Run flutter upgrade --force in the terminal

And I also changed the package

screenshot:2.0.0

with

screenshot:2.1.0

in the pubspec.yaml file manually. This worked for me

0

Try using version 1.3.0 of the library:

screenshot: ^1.3.0