Repository navigation
Scrollbar Exception caught by scheduler library #77609
Description
This issue is related to declarative navigation 2 and Navigator.pages.
If I request a page by URL and that page has another page underneath which contains Scrollbar this error happens:
======== Exception caught by scheduler library =====================================================
The following TypeErrorImpl was thrown during a scheduler callback:
Unexpected null value.
When the exception was thrown, this was the stack:
dart:sdk_internal 5041:11 throw_
dart:sdk_internal 5366:30 nullCheck
../packages/flutter/src/widgets/scroll_metrics.dart.lib.js 98:19 get maxScrollExtent
../packages/flutter/src/widgets/scrollbar.dart.lib.js 1304:34 [_handleScrollNotification]
../packages/flutter/src/widgets/widget_span.dart.lib.js 42486:59 [_dispatch]
...
My project is open source:
This is pages: https://github.com/aliyazdi75/gallery/blob/main/lib/presentation/screens/gallery/router.dart#L38
This is Scrollbar: https://github.com/aliyazdi75/gallery/blob/main/lib/presentation/screens/album/view/media/view/media.dart#L103
If I open the application by this URL: /gallery/album/album2?view=photo8
navigator.pages contains two pages: AlbumPage which has the Scrollbar and MediaFullscreenPage which is the front page.
Summary: If we open the application in a declarative way by the browser and it has a page underneath that contains Scrollbar this problem triggers.
Activity
TahaTesser commentedon Mar 9, 2021
Hi @aliyazdi75
To better address the issue, Can you please provide your
flutter doctor -vandflutter run --verboselogs, and a minimal complete reproducible code sample? instead of a projectThank you
aliyazdi75 commentedon Mar 9, 2021
Hi @TahaTesser
Implementing Navigation 2 it's not minimal at all 😄 , but I did my best to reproduce this issue.
1-
git clone [email protected]:5be066aa964b799fca66eebabec88c5f.gitin a null-safety flutter project. Hosted here and scrollbar is here2-
flutter run -d chrome --verbose3- Copy and paste to the end of the base and go to this URL:
/book/04- Exception:
--verbose output
flutter doctor -v output
TahaTesser commentedon Mar 10, 2021
Hi @aliyazdi75
Thanks for the code sample, I can reproduce the issue. No exception without scrollbar
code sample
logs
flutter doctor -v
[✓] Flutter (Channel stable, 2.0.1, on Linux, locale en_CA.UTF-8) • Flutter version 2.0.1 at /home/taha/Code/flutter_stable • Framework revision c5a4b4029c (6 days ago), 2021-03-04 09:47:48 -0800 • Engine revision 40441def69 • Dart version 2.12.0 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /home/taha/Code/SDK • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = /home/taha/Code/SDK • Java binary at: /home/taha/Code/android-studio/jre/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✓] Chrome - develop for the web • CHROME_EXECUTABLE = /snap/bin/chromium [✓] Linux toolchain - develop for Linux desktop • Ubuntu clang version 11.0.0-2 • cmake version 3.16.3 • ninja version 1.10.0 • pkg-config version 0.29.2 [!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions). [✓] VS Code (version 1.54.1) • VS Code at /usr/share/code • Flutter extension version 3.20.0 [✓] Connected device (2 available) • Linux (desktop) • linux • linux-x64 • Linux • Chrome (web) • chrome • web-javascript • Chromium 89.0.4389.82 snap ! Doctor found issues in 1 category.[✓] Flutter (Channel master, 2.1.0-11.0.pre.179, on Linux, locale en_CA.UTF-8) • Flutter version 2.1.0-11.0.pre.179 at /home/taha/Code/flutter_master • Framework revision 07e04484ea (4 hours ago), 2021-03-09 20:10:05 -0800 • Engine revision 7764b5c55f • Dart version 2.13.0 (build 2.13.0-116.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /home/taha/Code/SDK • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = /home/taha/Code/SDK • Java binary at: /home/taha/Code/android-studio/jre/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✓] Chrome - develop for the web • CHROME_EXECUTABLE = /snap/bin/chromium [✓] Linux toolchain - develop for Linux desktop • Ubuntu clang version 11.0.0-2 • cmake version 3.16.3 • ninja version 1.10.0 • pkg-config version 0.29.2 [✓] Android Studio (version 4.1) • Android Studio at /home/taha/Code/android-studio • Flutter plugin version 54.0.1 • Dart plugin version 201.9335 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) [✓] VS Code (version 1.54.1) • VS Code at /usr/share/code • Flutter extension version 3.20.0 [✓] Connected device (2 available) • Linux (desktop) • linux • linux-x64 • Linux • Chrome (web) • chrome • web-javascript • Chromium 89.0.4389.82 snap • No issues found!Thank you
aliyazdi75 commentedon Mar 11, 2021
@TahaTesser I think adding nnbd tag is useful.
flutter-triage-bot commentedon Dec 5, 2024
This issue is missing a priority label. Please set a priority label when adding the
triaged-designlabel.Piinks commentedon Dec 11, 2024
We think this is fixed, if it can still be reproduced, please file a new issue with an updated reproduction. Thank you!
github-actions commentedon Dec 25, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.