flutter_carousel_widget icon indicating copy to clipboard operation
flutter_carousel_widget copied to clipboard

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

Open xAlstrat opened this issue 2 years ago • 7 comments
trafficstars

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.

xAlstrat avatar Feb 10 '23 03:02 xAlstrat

Hi @xAlstrat,

Which package version are you using?

Thanks Nikhil

nixrajput avatar Feb 10 '23 14:02 nixrajput

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

using the version 2.0.2

MarioHBS avatar Feb 10 '23 14:02 MarioHBS

okay, let me check the issue.

nixrajput avatar Feb 12 '23 17:02 nixrajput

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

ghost avatar Feb 17 '23 06:02 ghost

Hey,

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

Thanks

nixrajput avatar Feb 17 '23 06:02 nixrajput

Hi there,

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

Regards,

HeXx123321 avatar Mar 09 '23 07:03 HeXx123321

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

HeXx123321 avatar Mar 10 '23 06:03 HeXx123321