flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.71k stars 27.36k forks source link

Exception caught by scheduler library #155356

Closed sweettirexkiller closed 1 month ago

sweettirexkiller commented 1 month ago

Steps to reproduce

  1. this is a company app, i cant give you code to reproduce this

Expected results

shouldn't throw error in terminal on regular logout and redirection

Actual results

everything works fine, just there is an error in terminal

Code sample

Code sample ```dart ref.listen(authNotifierProvider, (previous, next) { next.maybeWhen( error: (m) => { EasyLoading.dismiss(), ScaffoldMessenger.of(context).clearSnackBars(), ScaffoldMessenger.of(context).showSnackBar( const SnackBar( content: Text("Problem while logging out accoured.")), ) }, orElse: () => null, loading: (message) { EasyLoading.show(status: 'Logging out...'); }, unauthenticated: (message) => { EasyLoading.dismiss(), ScaffoldMessenger.of(context).showSnackBar( const SnackBar( duration: Duration(seconds: 5), content: Text("Goodbye!"), ), ), Navigator.pushReplacement( context, MaterialPageRoute(builder: (context) => const HomePage()), ), }, ); }); ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

Logs

Logs ```console ======== Exception caught by scheduler library ===================================================== The following assertion was thrown during a scheduler callback: 'package:flutter/src/widgets/heroes.dart': Failed assertion: line 669 pos 12: '() { final Animation initial = initialManifest.animation; final HeroFlightDirection type = initialManifest.type; switch (type) { case HeroFlightDirection.pop: return initial.value == 1.0 && initialManifest.isUserGestureTransition // During user gesture transitions, the animation controller isn't // driving the reverse transition, but should still be in a previously // completed stage with the initial value at 1.0. ? initial.status == AnimationStatus.completed : initial.status == AnimationStatus.reverse; case HeroFlightDirection.push: return initial.value == 0.0 && initial.status == AnimationStatus.forward; } }()': is not true. Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause. In either case, please report this assertion by filing a bug on GitHub: https://github.com/flutter/flutter/issues/new?template=2_bug.yml When the exception was thrown, this was the stack: #2 _HeroFlight.start (package:flutter/src/widgets/heroes.dart:669:12) #3 HeroController._startHeroTransition (package:flutter/src/widgets/heroes.dart:1004:60) #4 HeroController._maybeStartHeroTransition. (package:flutter/src/widgets/heroes.dart:926:9) #5 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1392:15) #6 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1326:11) #7 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1171:5) #8 _invoke (dart:ui/hooks.dart:312:13) #9 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:419:5) #10 _drawFrame (dart:ui/hooks.dart:283:31) (elided 2 frames from class _AssertionError) ==================================================================================================== ```

Flutter Doctor output

Doctor output ```console [✓] Flutter (Channel stable, 3.22.2, on macOS 13.2.1 22D68 darwin-x64, locale en-GB) • Flutter version 3.22.2 on channel stable at /Users/stanislawjankiewicz/development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 761747bfc5 (4 months ago), 2024-06-05 22:15:13 +0200 • Engine revision edd8546116 • Dart version 3.4.3 • DevTools version 2.34.3 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/stanislawjankiewicz/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) • All Android licenses accepted. [!] Xcode - develop for iOS and macOS (Xcode 14.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14E300c ! Flutter recommends a minimum Xcode version of 15. Download the latest version or update via the Mac App Store. • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2024.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) [✓] IntelliJ IDEA Ultimate Edition (version 2024.1.4) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.92.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.94.0 [✓] Connected device (3 available) • SNE LX1 (mobile) • HYF0218811009789 • android-arm64 • Android 10 (API 29) • macOS (desktop) • macos • darwin-x64 • macOS 13.2.1 22D68 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 128.0.6613.138 [✓] Network resources • All expected network resources are available. ```
darshankawar commented 1 month ago

@sweettirexkiller Looking at the error log, it seems similar to https://github.com/flutter/flutter/issues/115358 which has been fixed recently and should be available in latest master channel. Please switch to it and re-run your scenario to confirm.

Since this is already fixed, I will close this for now. If you disagree, write in comments and I'll reopen it.

github-actions[bot] commented 3 weeks ago

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 -v and a minimal reproduction of the issue.