EdsonBueno / infinite_scroll_pagination

Flutter package to help you lazily load and display pages of items as the user scrolls down your screen.
https://pub.dev/packages/infinite_scroll_pagination
MIT License
623 stars 210 forks source link

iOS build failed using version 3.2.0 #199

Closed mahendragp closed 2 years ago

mahendragp commented 2 years ago

It gives the following error.

Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.
../…/ui/paged_sliver_builder.dart:254
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../../../fvm/versions/stable/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
    Try calling using ?. instead.
            WidgetsBinding.instance.addPostFrameCallback((_) {
                                    ^^^^^^^^^^^^^^^^^^^^
    Failed to package /Users/localadmin/Desktop/PGA/PGA_App/PGA_mobile_app/pocketdrive-mobile-app/pocketdrive.
    Command PhaseScriptExecution failed with a nonzero exit code

I have used the following version in pubspec file. infinite_scroll_pagination: ^3.2.0

Flutter doctor

[✓] Flutter (Channel stable, 2.8.1, on macOS 12.3.1 21E258 darwin-x64, locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.67.2)
[✓] Connected device (2 available)
    ! Error: iPhone 12 is not connected. Xcode will continue when iPhone 12 is connected. (code -13)

! Doctor found issues in 1 category.

Seems like the package is updated recently and it has the above mentioned error.

EdsonBueno commented 2 years ago

Which version of the package are you using? In the title, you mentioned 3.2.0, but then your description says 3.1.0. This shouldn't happen on 3.2.0. I'm closing the issue for now but feel free to reopen if you get the same error on 3.2.0.

mahendragp commented 2 years ago

Sorry, I mentioned the wrong version. Anyway I have updated the description. I am using 3.2.0.