Comments (10)
from searchable_dropdown.
Hello @Robinp1011 ,
I was able to compile and run with the following code:
Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 14),
child: new TextField(
// maxLengthEnforced: true,
keyboardType: TextInputType.multiline,
// controller: controller1,
decoration: new InputDecoration(
// contentPadding: EdgeInsets.symmetric(vertical: 26,horizontal: 10),
border: OutlineInputBorder(),
hintText: "Add Task name Only",
labelText: "Add Task name only"
),
),
),
new SizedBox(
height:6
),
Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
new Text("Select Product:", style: new TextStyle(fontSize: 12),),
],
),
Container(
height: 150,
// width: MediaQuery.of(context).size.width,
width:150,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(width: 1.0, style: BorderStyle.solid, color: Colors.blue),
borderRadius: BorderRadius.all(Radius.circular(5.0)),
),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal:10.0),
child: StatefulBuilder(
//stream: null,
builder: (BuildContext context, StateSetter setState) {
/* return DropdownButton<String>(
// hint: Text('Project'),
value:applicationDropDown,
isExpanded: true,
// style: Theme.of(context).textTheme.title,
// icon: Icon(Icons.arrow_drop_down,color: Colors.lightBlue,),
onChanged: (String newValue) {
setState(() {
applicationDropDown = newValue;
});
},
items: applicationList.cast<String>()
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
})
.toList()
); */
return SearchableDropdown.single(
items: items,
value: selectedValue,
hint: "Select one",
searchHint: "Select one",
onChanged: (value) {
setState(() {
selectedValue = value;
});
},
isExpanded: true,
// label: "Select Project",
selectedValueWidgetFn: (item) {
return Container(
transform: Matrix4.translationValues(-10,0,0),
alignment: Alignment.centerLeft,
child: (Text(item.toString())));
},
// style: Theme.of(context).textTheme.title,
displayClearIcon: false,
);
}
),
),
),
],
),
Padding(
padding: const EdgeInsets.only(top:7.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Column(
// mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Text("Select Customer:", style: new TextStyle(fontSize: 12),),
Container(
height: 150,
// width: MediaQuery.of(context).size.width/2,
width: 150,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(width: 1.0, style: BorderStyle.solid, color: Colors.blue),
borderRadius: BorderRadius.all(Radius.circular(5.0)),
),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal:10.0),
child: StatefulBuilder(
//stream: null,
builder: (BuildContext context, StateSetter setState) {
return SearchableDropdown.single(
items: items,
value: selectedValue,
hint: "Select one",
searchHint: "Select one",
onChanged: (value) {
setState(() {
selectedValue = value;
});
},
isExpanded: true,
// label: "Select Project",
selectedValueWidgetFn: (item) {
return Container(
transform: Matrix4.translationValues(-10,0,0),
alignment: Alignment.centerLeft,
child: (Text(item.toString())));
},
// style: Theme.of(context).textTheme.title,
displayClearIcon: false,
);
}
),
),
),])]))]
)
As you can see, I had to change the width and height values. I also had to add some parentheses/brackets.
But these don't seem to be related to your question.
You are talking about the TextField. Maybe your issue is related to the controller1
? Indeed, I also had to comment that part as the definition was not in your example.
Sorry, for me, the TextField value doesn't change when I change searchable_dropdown
selected value.
I wish I could help you but I believe that I am missing information related to controller1
.
from searchable_dropdown.
Sir my real issue is whenever i select the dropdown value keyboard is opening and cursor move to the textfiled i don't know why keyboard is appearing on the screen whenever i select dropdown value.
Please check it once
from searchable_dropdown.
Hi @Robinp1011 ,
Thanks for the explanation.
I think I understand the following steps to reproduce:
- click on one of the 2
searchable_dropdown
widgets (I'll take the product one). - select one item.
Expected behavior:
The task name TextField is not focused and no keyboard is displayed.
Effective behavior:
The task name TextField is focused and a keyboard is displayed.
Is this correct?
If so, in fact, I witness the expected behavior, no keyboard is displayed once the item is selected.
I tried this on a Samsung hardware and on an emulated device with the same results. Here is a video of the emulated device:
So, to display the keyboard once the item is selected, I have to click on the TextField.
from searchable_dropdown.
Sir once try by filling the textfield first then select dropdown then keyboard will appear again on the screen
https://drive.google.com/open?id=1ESorh9wFQfaejAqS2jL0L9vXJ4wFyd1H
sir this is the link of the video of screen record of my phone.
You can clearly see in this video that whenever i am selecting the dropdown button after filling the textfiled keyboard is opening again.
from searchable_dropdown.
Hi @Robinp1011 ,
Thanks for the explanation.
I think I understand the following steps to reproduce:
- click on one of the 2
searchable_dropdown
widgets (I'll take the product one).- select one item.
Expected behavior:
The task name TextField is not focused and no keyboard is displayed.Effective behavior:
The task name TextField is focused and a keyboard is displayed.Is this correct?
If so, in fact, I witness the expected behavior, no keyboard is displayed once the item is selected.
I tried this on a Samsung hardware and on an emulated device with the same results. Here is a video of the emulated device:
So, to display the keyboard once the item is selected, I have to click on the TextField.
yes sir this is correct when you select the dropdown first then keyboard is not coming on the screen.
But when you select the dropdown after filling textfield then focus again come on textfield and keyboard appears on the screen
from searchable_dropdown.
Oh, ok, I understand.
Steps to reproduce:
- tap on TextField
- type name on keyboard
- tap on SearchableDropdown
- select item
Expected behavior:
TextField unfocused and keyboard not displayed
Effective behavior:
TextField focused and keyboard displayed
I confirm that I also witness this behavior on my device.
In that case, maybe, this link could help you?
https://flutterigniter.com/dismiss-keyboard-form-lose-focus/
from searchable_dropdown.
Oh, ok, I understand.
Steps to reproduce:
- tap on TextField
- type name on keyboard
- tap on SearchableDropdown
- select item
Expected behavior:
TextField unfocused and keyboard not displayedEffective behavior:
TextField focused and keyboard displayedI confirm that I also witness this behavior on my device.
In that case, maybe, this link could help you?
https://flutterigniter.com/dismiss-keyboard-form-lose-focus/
Thanks sir now it is working perfect
Thanks for your help
from searchable_dropdown.
You’re welcome @Robinp1011 !
I’m glad it works.
Enjoy!
from searchable_dropdown.
Hello @Robinp1011 ,
Could you write how did you managed this issue please ?
from searchable_dropdown.
Related Issues (20)
- Selcted value is not changes if I give preselected value HOT 6
- Search is not working when i use value as Id inside onChanged
- How to get the selected value not index in multiple?
- Search is not working when, I use value as Id Int inside Value DropdownMenuItem HOT 1
- Provide async call to API on typing search HOT 1
- null safety HOT 1
- Clear the selected value programatically
- Is it possible to reduce the popup size like height , width after dropdown is opened HOT 1
- selectedItems how to get values in string instead of id in numbers HOT 1
- When dropdown is clicked, UI should not get expanded, the items should display like normal dropdown effect HOT 1
- By default selected initial value HOT 1
- Add the ability to put hints in dialog search
- Need support for search delay (debounce) HOT 4
- Remove default padding HOT 2
- In multiple select option is not working properly
- Failed to build iOS app
- Compilation failed Flutter 2.5.0 HOT 7
- The getter 'subhead' isn't defined for the class 'TextTheme' - Cannot Debug/Run Flutter App HOT 13
- Can you update library to version 2 with null safty? HOT 1
- error HOT 3
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 searchable_dropdown.