Skip to content

Commit

Permalink
Change the dispose order and dispose the overlayEntry first (#299)
Browse files Browse the repository at this point in the history
Co-authored-by: Mateusz Maziec <matthias.maziec@mintellity.com>
  • Loading branch information
bobekos and Mateusz Maziec authored Mar 16, 2023
1 parent f1fda4f commit aab6fd4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/speed_dial.dart
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ class _SpeedDialState extends State<SpeedDial>

@override
void dispose() {
if (widget.renderOverlay && backgroundOverlay != null) {
if (backgroundOverlay!.mounted) backgroundOverlay!.remove();
backgroundOverlay!.dispose();
}
if (overlayEntry != null) {
if (overlayEntry!.mounted) overlayEntry!.remove();
overlayEntry!.dispose();
}
if (widget.renderOverlay && backgroundOverlay != null) {
if (backgroundOverlay!.mounted) backgroundOverlay!.remove();
backgroundOverlay!.dispose();
}
_controller.dispose();
widget.openCloseDial?.removeListener(_onOpenCloseDial);
super.dispose();
Expand Down

0 comments on commit aab6fd4

Please sign in to comment.