Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Method 'readState' cannot be called on 'PageStorageBucket?' because it is potentially null #12

Open
xAlstrat opened this issue Feb 10, 2023 · 7 comments

Comments

@xAlstrat
Copy link

I'm using Flutter 3.3.8v

Full error is:

../../development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_carousel_widget-2.0.2/lib/src/_flutter_carousel_widget.dart:368:22: Error: Method 'readState' cannot be called on 'PageStorageBucket?' because it is potentially null.
 - 'PageStorageBucket' is from 'package:flutter/src/widgets/page_storage.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/page_storage.dart').
Try calling using ?. instead.
                    .readState(storageContext) as double?;
                     ^^^^^^^^^

Looks like the solution is easy, but not sure if compatible with older versions of flutter.

@nixrajput
Copy link
Owner

Hi @xAlstrat,

Which package version are you using?

Thanks
Nikhil

@MarioHBS
Copy link

I came here for the same problem, since yesterday this issue is happening

using the version 2.0.2

@nixrajput
Copy link
Owner

okay, let me check the issue.

@fahad-whizpool
Copy link

fahad-whizpool commented Feb 17, 2023

I'm using Flutter 3.3.9v
Hi there I faced the same issue at flutter_carousel_widget: ^2.0.2. Kindly tell me the solution

@nixrajput
Copy link
Owner

Hey,

Either upgrade Flutter to the latest version or downgrade the package version to 2.0.1

Thanks

@HeXx123321
Copy link

Hi there,

Issue still persists with downgrade to 2.0.0 and 2.0.1 Any other ideas?

Regards,

@HeXx123321
Copy link

Hi there,

Issue still persists with downgrade to 2.0.0 and 2.0.1 Any other ideas?

Regards,

Hi there,

Solution is to upgrade Flutter, run flutter upgrade in any terminal

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants