Пример #1
0
            public override Widget build(BuildContext buildContext)
            {
                return(new Clickable(
                           onTap: () =>
                {
                    if (_expanded)
                    {
                        return;
                    }
                    _expanded = true;
                    switch (widget._overlayType)
                    {
                    case DropDownOverlayType.scrollable:
                        _guid = ScrollableOverlay.of(buildContext).Add(_dropDownOverlayBuilder);
                        break;

                    case DropDownOverlayType.builtin:
                        Overlay.of(buildContext).insert(_overlayEntry);
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }

                    if (_screenOverlayState == null)
                    {
                        _screenOverlayState = ScreenOverlay.of(buildContext);
                    }
                    _screenOverlayState.AddOnTapListener(OnScreenTap);
                },
                           child: widget._selectBuilder.Invoke()
                           ));
            }
 public override void initState()
 {
     base.initState();
     _filterType            = FilterType.manual;
     _textEditingController = new TextEditingController();
     _focusNode             = new FocusNode();
     _screenOverlayState    = ScreenOverlay.of(context);
     _screenOverlayState.AddOnTapListener(LoseFocus);
 }