Closed raviranjan31 closed 1 year ago
Same here
Just accept the pull request please
Thank you for the lib. Same issue? I revert to 3.1.0 and the problem's gone.
../../FlutterProjects/flutter/.pub-cache/hosted/pub.dartlang.org/infinite_scroll_pagination-3.2.0/lib/src/ui/paged_sliver_builder.dart:254:33: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.
FAILURE: Build failed with an exception.
I've solved this error putting a null-check on /.pub-cache/hosted/pub.dartlang.org/infinite_scroll_pagination-3.2.0/lib/src/ui/paged_sliver_builder.dart
to don't execute function if the instance is null...
On the line 254 where it's written:
WidgetsBinding.instance.addPostFrameCallback((_) {
change it to:
WidgetsBinding.instance?.addPostFrameCallback((_) {
.
version 3.2.0 of this package has specifically removed that so that it removes a warning in flutter version 3.0.
please upgrade to flutter version 3.0. if you do not plan on upgrading to version 3.0, then there is no reason to use version 3.2.0 of this package. you can downgrade to version 3.1.0.
Compiling lib/main.dart for the Web...
Target dart2js failed: Exception: /root/.pub-cache/hosted/pub.dartlang.org/infinite_scroll_pagination-3.2.0/lib/src/ui/paged_sliver_builder.dart:254:33: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.