Skip to content

Commit

Permalink
Merge pull request #4 from josephchenghmlet/issue-3
Browse files Browse the repository at this point in the history
Fix Issue 3
  • Loading branch information
GanZhiXiong authored Jul 30, 2019
2 parents 2113b57 + 19fa5a1 commit ce43417
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/gzx_dropdown_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GZXDropDownMenu extends StatefulWidget {
class _GZXDropDownMenuState extends State<GZXDropDownMenu> with SingleTickerProviderStateMixin {
bool _isShowDropDownItemWidget = false;
bool _isShowMask = false;

bool _isControllerDisposed = false;
Animation<double> _animation;
AnimationController _controller;

Expand Down Expand Up @@ -52,6 +52,7 @@ class _GZXDropDownMenuState extends State<GZXDropDownMenu> with SingleTickerProv

dispose() {
_controller.dispose();
_isControllerDisposed = true;
super.dispose();
}

Expand All @@ -70,6 +71,8 @@ class _GZXDropDownMenuState extends State<GZXDropDownMenu> with SingleTickerProv
setState(() {});
});

if (_isControllerDisposed) return;

if (_animation.status == AnimationStatus.completed) {
_controller.reverse();
} else {
Expand Down

0 comments on commit ce43417

Please sign in to comment.