darioielardi / flutter_speed_dial

Flutter plugin to implement a Material Design Speed Dial
https://pub.dev/packages/flutter_speed_dial
MIT License
416 stars 178 forks source link

6.1.0+1 broke the dispose method #275

Closed TheCarpetMerchant closed 1 year ago

TheCarpetMerchant commented 1 year ago

I've got 1800 crashes across 700 users since updating to 6.1.0+1, so this is not a freak case.

Here's the complete stacktrace, but only the last 2 are relevant :

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown Instance of 'ErrorSummary'.
       at OverlayEntry.remove(overlay.dart:163)
       at _SpeedDialState.dispose(speed_dial.dart:232)
       at StatefulElement.unmount(framework.dart:5105)
       at _InactiveElements._unmount(framework.dart:1917)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at SingleChildRenderObjectElement.visitChildren(framework.dart:6286)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at SingleChildRenderObjectElement.visitChildren(framework.dart:6286)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at MultiChildRenderObjectElement.visitChildren(framework.dart:6398)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at MultiChildRenderObjectElement.visitChildren(framework.dart:6398)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at SingleChildRenderObjectElement.visitChildren(framework.dart:6286)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at SingleChildRenderObjectElement.visitChildren(framework.dart:6286)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at SingleChildRenderObjectElement.visitChildren(framework.dart:6286)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at SingleChildRenderObjectElement.visitChildren(framework.dart:6286)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at SingleChildRenderObjectElement.visitChildren(framework.dart:6286)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at SingleChildRenderObjectElement.visitChildren(framework.dart:6286)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at SingleChildRenderObjectElement.visitChildren(framework.dart:6286)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at SingleChildRenderObjectElement.visitChildren(framework.dart:6286)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at SingleChildRenderObjectElement.visitChildren(framework.dart:6286)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at SingleChildRenderObjectElement.visitChildren(framework.dart:6286)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at _InactiveElements._unmount.<fn>(framework.dart:1915)
       at ComponentElement.visitChildren(framework.dart:4931)
       at _InactiveElements._unmount(framework.dart:1913)
       at ListIterable.forEach(dart:_internal)
       at _InactiveElements._unmountAll(framework.dart:1926)
       at BuildOwner.lockState(framework.dart:2523)
       at BuildOwner.finalizeTree(framework.dart:2947)
       at WidgetsBinding.drawFrame(binding.dart:885)
       at RendererBinding._handlePersistentFrameCallback(binding.dart:378)
       at SchedulerBinding._invokeFrameCallback(binding.dart:1175)
       at SchedulerBinding.handleDrawFrame(binding.dart:1104)
       at SchedulerBinding._handleDrawFrame(binding.dart:1015)
pst9354 commented 1 year ago

Any estimate on when a new version will be released?

prateekmedia commented 1 year ago

@pst9354 Did the new version fixed the issue for you?

pst9354 commented 1 year ago

@prateekmedia Sorry, I haven't tested the "fix". Just experiencing the same problems as the threads author...

pst9354 commented 1 year ago

6.1.0+1 is still the latest version on pub.dev

prateekmedia commented 1 year ago

@pst9354 Can you try this git version and see it the issue persists?

pst9354 commented 1 year ago

Yes, the problem is that I can't provoke the error, just seen it in our crashlogs. But I will try it out.

Maybe @TheCarpetMerchant can provoke it?

pst9354 commented 1 year ago

Deleted the above post, since I wasn't referencing the latest commit.

TheCarpetMerchant commented 1 year ago

Nope, can't provoke it. I'll try out the committed update on prod once it's published.

d9media commented 1 year ago

I use 6.2.0 and we're seeing the same. I spent so many hours trying to debug this until I noticed it happens with SpeedDial. Basiscally it makes the entire UI freeze. Both Android and IOS by the way.

Not an issue with our previous release which used an earlier version of SpeedDial

d9media commented 1 year ago

Can we not put this in a try catch block or something so at least it doesn't crash everything please

_AssertionError ('package:flutter/src/widgets/overlay.dart': Failed assertion: line 210 pos 12: '_overlay == null': An OverlayEntry must first be removed from the Overlay before dispose is called.)

call stack

_AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51) _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40) OverlayEntry.dispose (/flutter/packages/flutter/lib/src/widgets/overlay.dart:210) _SpeedDialState.dispose (/Users/daniel/.pub-cache/hosted/pub.dartlang.org/flutter_speed_dial-6.2.0/lib/src/speed_dial.dart:253) StatefulElement.unmount (/flutter/packages/flutter/lib/src/widgets/framework.dart:5105) _InactiveElements._unmount (/flutter/packages/flutter/lib/src/widgets/framework.dart:1917) _InactiveElements._unmount.<anonymous closure> (/flutter/packages/flutter/lib/src/widgets/framework.dart:1915) SingleChildRenderObjectElement.visitChildren (/flutter/packages/flutter/lib/src/widgets/framework.dart:6286) _InactiveElements._unmount (/flutter/packages/flutter/lib/src/widgets/framework.dart:1913) _InactiveElements._unmount.<anonymous closure> (/flutter/packages/flutter/lib/src/widgets/framework.dart:1915) SingleChildRenderObjectElement.visitChildren (/flutter/packages/flutter/lib/src/widgets/framework.dart:6286) _InactiveElements._unmount (/flutter/packages/flutter/lib/src/widgets/framework.dart:1913) _InactiveElements._unmount.<anonymous closure> (/flutter/packages/flutter/lib/src/widgets/framework.dart:1915) ComponentElement.visitChildren (/flutter/packages/flutter/lib/src/widgets/framework.dart:4931) _InactiveElements._unmount (/flutter/packages/flutter/lib/src/widgets/framework.dart:1913) _InactiveElements._unmount.<anonymous closure> (/flutter/packages/flutter/lib/src/widgets/framework.dart:1915) SingleChildRenderObjectElement.visitChildren (/flutter/packages/flutter/lib/src/widgets/framework.dart:6286) _InactiveElements._unmount (/flutter/packages/flutter/lib/src/widgets/framework.dart:1913) _InactiveElements._unmount.<anonymous closure> (/flutter/packages/flutter/lib/src/widgets/framework.dart:1915) ComponentElement.visitChildren (/flutter/packages/flutter/lib/src/widgets/framework.dart:4931)

Downgrading to 6.0 now. I'll report more.

EDIT: 6.1.0 same problem speed_dial.dart:238 backgroundOverlay?.remove(); EDIT: 6.0.0 same speed_dial.dart:220 backgroundOverlay?.remove();

tomorrow maybe I can dig a bit deeper. but i'm fairly sure this part is the culprit. In our case, we use speeddial to set a firebase value which, further up in the widget tree,determines wether to show the home view (the one with speeddial) or another widget (introduction - which freezes the app because of the error highlighted). Then when I skip over it, I get

_AssertionError ('package:flutter/src/widgets/overlay.dart': Failed assertion: line 161 pos 12: '_overlay != null': is not true.)

FlutterError (Looking up a deactivated widget's ancestor is unsafe. At this point the state of the widget's element tree is no longer stable. To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method.)

prateekmedia commented 1 year ago

@d9media Can you create a Pull Request for the same?

d9media commented 1 year ago

Crash also at 5.1.0 at backgroundOverlay?.remove(); line 216 EDIT: Actually, I downgraded as far as 4.6.6 and the problems keeps happening. So strange! Did something in Flutter change that triggers this error? Actually, I still get the exception even when using renderOverlay: false,