Comments (7)
@rosbal Hi, I figured out how to solve it.
Need to modify the original code.
Add a dismiss function
static void dismissMenu() { if (overlayEntry != null) { overlayEntry.remove(); overlayEntry = null; _controller.clear(); _focusNode.unfocus(); } }
And then make the overlay into a stack and make the bottom layer take up the full screen, wrap it's child in a GestureDetector that calls:
return Stack(children: <Widget>[ Positioned.fill( child: GestureDetector( onTap: dismissMenu, child: Container( color: Colors.transparent, ), )), Positioned( left: position.left, width: width, child: CompositedTransformFollower( .....
from search_widget.
Here is the code thanks to Charon922 comment ! I will try to make a pull request
search_widget copie.dart.txt
from search_widget.
Thank you much @dleurs
from search_widget.
And when I scroll the screen, it is being wired.
from search_widget.
Same question. There should be a way to dismiss the popup by tapping anywhere outside the popup (at the very least on tapping the TextField). The only way to dismiss the popup seems to be selecting a list item.
from search_widget.
Worked like a charm. Thanks for sharing.
from search_widget.
@rosbal Hi, I figured out how to solve it.
Need to modify the original code.
Add a dismiss function
static void dismissMenu() { if (overlayEntry != null) { overlayEntry.remove(); overlayEntry = null; _controller.clear(); _focusNode.unfocus(); } }
And then make the overlay into a stack and make the bottom layer take up the full screen, wrap it's child in a GestureDetector that calls:
return Stack(children: <Widget>[ Positioned.fill( child: GestureDetector( onTap: dismissMenu, child: Container( color: Colors.transparent, ), )), Positioned( left: position.left, width: width, child: CompositedTransformFollower( .....
Hello...
@Charon922 I am having this same issue and I don't understand your solution, Where do you make these changes?? and would you be able to give a more detailed example.
Please do forgive me If this sounds like an awkward request I am new to flutter
from search_widget.
Related Issues (20)
- Remove overlay on dispose HOT 2
- Problem on selecting item HOT 2
- [web] Positioning issue with overlay HOT 9
- Does not return the selected item on filtered list HOT 3
- Update MyTextField HOT 3
- Hello, how can I make popup appear after input?
- The method 'toLowerCase' was called on null. HOT 1
- Selecting an item from the popup list does not hide the popup
- flutter_keyboard_visibility new version
- close indication HOT 1
- suggestionsBoxController.close() not working when hideSuggestionsOnKeyboardHide: false
- hide dropdown list builder if not type anything in textbox HOT 2
- Added null safety HOT 2
- Depricated API used HOT 3
- The method 'markNeedsBuild' was called on null. HOT 4
- Android emulator doesn't work HOT 1
- After I updated the flutter v1.13.2 He is returning this error to me. HOT 1
- Showing Error in Both iOS and Android HOT 1
- Exception caught by services library: MissingPluginException HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from search_widget.