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

scrollable_positioned_list stopped worked after flutter 1.22 upgrade #183

Closed
bachras opened this issue Oct 6, 2020 · 14 comments
Closed
Assignees

Comments

@bachras
Copy link

bachras commented Oct 6, 2020

Problem description

scrollable_positioned_list stopped worked after flutter 1.22 upgrade.

Steps to reproduce

  1. Build demo app
  2. Copy scrollable_positioned_list example code https://pub.dev/packages/scrollable_positioned_list/example
  3. Run the app

Expected behavior

Working scrollable positioned list.

Actual behavior

Exception thrown

I/flutter (15302): ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter (15302): The following NoSuchMethodError was thrown during a scheduler callback:
I/flutter (15302): The method 'toDouble' was called on null.
I/flutter (15302): Receiver: null
I/flutter (15302): Tried calling: toDouble()
I/flutter (15302):
I/flutter (15302): When the exception was thrown, this was the stack:
I/flutter (15302): #0      Object.noSuchMethod  (dart:core-patch/object_patch.dart:51:5))
I/flutter (15302): #1      int./  (dart:core-patch/integers.dart:28:36))
I/flutter (15302): #2      _PositionedListState._schedulePositionNotificationUpdate.<anonymous closure> 
package:scrollable_positioned_list/src/positioned_list.dart:321
I/flutter (15302): #3      SchedulerBinding._invokeFrameCallback 
package:flutter/…/scheduler/binding.dart:1117
I/flutter (15302): #4      SchedulerBinding.handleDrawFrame 
package:flutter/…/scheduler/binding.dart:1063
I/flutter (15302): #5      SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> 
package:flutter/…/scheduler/binding.dart:864
I/flutter (15302): (elided 11 frames from class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)
I/flutter (15302): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter (15302): Loaded flutter-ffmpeg-android-x86.
I/flutter (15302): Another exception was thrown: NoSuchMethodError: The method 'toDouble' was called on null.

Environment

Android
Flutter doctor summary:
flutter doctor -v
[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.6 19G2021, locale en-GB)
• Flutter version 1.22.0 at /Users/art/Development/flutter
• Framework revision d408d302e2 (7 days ago), 2020-09-29 11:49:17 -0700
• Engine revision 5babba6c4d
• Dart version 2.10.0

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /usr/local/Caskroom/android-sdk/25.2.3
• Platform android-29, build-tools 28.0.3
• ANDROID_HOME = /usr/local/Caskroom/android-sdk/25.2.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0, Build version 12A7209
• CocoaPods version 1.9.3

[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 44.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.49.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.15.0

[✓] Connected device (1 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

• No issues found!

@Mehedi50200
Copy link

Mehedi50200 commented Oct 6, 2020

I am having the same issue after the upgrade. This issue was also there before but if I remember correctly there was a quick fix last time. Now it is back again.

Flutter 1.22.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d408d302e2 (7 days ago) • 2020-09-29 11:49:17 -0700
Engine • revision 5babba6c4d
Tools • Dart 2.10.0

Exception thrown

E/flutter (11873): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: NoSuchMethodError: The method '_mulFromInteger' was called on null.
E/flutter (11873): Receiver: null
E/flutter (11873): Tried calling: _mulFromInteger(2)
E/flutter (11873): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
E/flutter (11873): #1 int.* (dart:core-patch/integers.dart:16:38)
E/flutter (11873): #2 _ScrollablePositionedListState._startScroll (package:flutter_widgets/src/scrollable_positioned_list/src/scrollable_positioned_list.dart:356:45)
E/flutter (11873): #3 _ScrollablePositionedListState._scrollTo (package:flutter_widgets/src/scrollable_positioned_list/src/scrollable_positioned_list.dart:341:13)
E/flutter (11873): #4 ItemScrollController.scrollTo (package:flutter_widgets/src/scrollable_positioned_list/src/scrollable_positioned_list.dart:181:33)

@haroonkhan335
Copy link

same issue is happening for me as well..

@tarobins tarobins self-assigned this Oct 7, 2020
@tarobins
Copy link
Collaborator

tarobins commented Oct 7, 2020

looking...

@tarobins
Copy link
Collaborator

tarobins commented Oct 7, 2020

I haven't been able to repo.

With this project https://github.com/tarobins/spl_example_wrapper I was able to get it to run on

[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.6 19G2021, locale en-US)

See image

image

Can someone maybe post a repo where the example doesn't work that I can clone and see if there's something slightly different?

@Mehedi50200
Copy link

Mehedi50200 commented Oct 7, 2020

Hi Thank you for your quick response..
I created a basic app for this purpose but apparently having the same error.

MINIMAL CODE FOR REPRODUCE
https://github.com/Mehedi50200/sp_example.git

Version
Flutter 1.22.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d408d302e2 (8 days ago) • 2020-09-29 11:49:17 -0700
Engine • revision 5babba6c4d
Tools • Dart 2.10.0

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.22.0, on Microsoft Windows [Version 10.0.18363.1082], locale en-MY)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[√] Android Studio (version 4.0)
[√] VS Code (version 1.49.3)
[√] Connected device (2 available)

• No issues found!

@tarobins
Copy link
Collaborator

tarobins commented Oct 8, 2020

I got the exception with the above example. will take a look. thanks

@a-v-ebrahimi
Copy link

Thanks, looking forward to the fix, one of my products stopped functioning because of this problem.

@haroonkhan335
Copy link

Thanks, looking forward to the fix, one of my products stopped functioning because of this problem.

Yup.. for me as well... Looking forward to get it fixed soon :)

@tarobins
Copy link
Collaborator

tarobins commented Oct 8, 2020

I was able to fix the example @Mehedi50200 gave with tarobins/sp_example@41ab3fa (ignore the pubspec.lock changes: after making the other changes and running flutter pub get, the lock file should update).

Basically I switched from the old mono-package flutter_widgets to the new scrollable_positioned_list package. If you need other widgets from flutter_widgets, the new packages can be found listed at the top of https://pub.dev/packages/flutter_widgets.

If anyone is indeed using the scrollable_positioned_list package, and the latest version thereof, and still running into issues, please let me know.

@tarobins
Copy link
Collaborator

tarobins commented Oct 8, 2020

Thanks @Mehedi50200 for the example repo. Would have been very hard to figure out the issue (if that is indeed the only issue) without the example.

@Mehedi50200
Copy link

Mehedi50200 commented Oct 8, 2020

Thanks @Mehedi50200 for the example repo. Would have been very hard to figure out the issue (if that is indeed the only issue) without the example.

thank you a lot for the quick fix. you are great !!. i already tested on my production application with scrollable_positioned_list pack. worked like a charm. i did not use any other widget from flutter_widgets so cannot be sure if that is the only one.
Thanks again for the quick fix otherwise i would have to push back the production. <3

@bachras
Copy link
Author

bachras commented Oct 8, 2020

I am using scrollable_positioned_list directly, not via flutter_widgets. At the minute, I am unable to reproduce an error on newly built flutter app, but still have problem on my original project. I will try to reproduce the exception on demo app and share the repo.

@a-v-ebrahimi
Copy link

@tarobins Thanks a lot for the quick fix!👏
This worked like a charm: tarobins/sp_example@41ab3fa

@bachras
Copy link
Author

bachras commented Oct 9, 2020

I have ended up creating new app and copying dart files as original project was created pre flutter 1.12 and I assume that was causing the issue. It works now. 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