Skip to content

Commit

Permalink
Merge pull request #4 from AonoCandal/master
Browse files Browse the repository at this point in the history
fix issue #3 列表项添加点击跳转到其他页面之后回来, 下拉菜单就不会弹出了
  • Loading branch information
jzoom authored Sep 19, 2018
2 parents 4599c2c + 8f5f20e commit 16dd4d0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/drapdown_common.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';

enum DropdownEvent {
// the menu will hide
Expand Down Expand Up @@ -158,14 +158,16 @@ abstract class DropdownState<T extends DropdownWidget> extends State<T> {

@override
void didChangeDependencies() {
if (widget.controller == null) {
controller = DefaultDropdownMenuController.of(context);
} else {
controller = widget.controller;
}
if (controller == null) {
if (widget.controller == null) {
controller = DefaultDropdownMenuController.of(context);
} else {
controller = widget.controller;
}

if (controller != null) {
controller.addListener(_onController);
if (controller != null) {
controller.addListener(_onController);
}
}
super.didChangeDependencies();
}
Expand Down

0 comments on commit 16dd4d0

Please sign in to comment.