-
-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DropdownSearch value resets whole changing focus #51
Comments
check v 0.4.6, this should be fixed. |
Okay will try out |
I tried but this problem still there secondly If you save data and restart the app how to update the widget to that state |
Let me know if I want to reopen the issue or create a new one |
Check my anwser in stackoverflow, let me know if it works for you. I'm waiting for your feedback Edit: |
Thank you very much for such a quick reply and I apologize that I didn't look at the link for Stackoverflow and commented, however, I found it later the both of my questions are answered.
Thanks again for helping.
Regards,Zafar
On Thursday, November 5, 2020, 01:08:37 AM GMT+5, Salim Lachdhaf <notifications@github.com> wrote:
Check my anwser in stackoverflow, let me know if it works for you.
And take a look to this it could help
#56
I'm waiting for your feedback
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Thank you very much for such a quick reply and I apologize that I didn't look at the link for Stackoverflow and commented, however, I found it later the both of my questions are answered. Thanks again for helping. Regards, |
Hi I have tested it, its working thanks for the fix |
I was trying to use the Widget in a row and also in a dynamic widget, the problem is that as change the focus to other input widgets the value resets. In case you use selecteditem attribute then it resets to the initial value.
Row( children: [ Flexible( flex: 1, child: Padding( padding: EdgeInsets.only(left: 5), child: TextFormField( controller: _descriptionController, onChanged: (v) => _UpdateFormState.descriotiondata[widget.index] = v, validator: (v) { if (v .trim() .isEmpty) return 'Please enter Study Description'; return null; }, style: TextStyle(color: Colors.blue), decoration: InputDecoration( counterText: '', filled: true, fillColor: Color(0xFFF5F5F5), labelText: "Description", labelStyle: TextStyle(color: Color(0xFF45B4FF)), focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.blueAccent, width: 1.0), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.blueGrey, width: 1.0), ), ), ), ), /* TextFormField( controller: _descriptionController, onChanged: (v) { _UpdateFormState.descriotiondata[widget.index] = v; }, decoration: InputDecoration( hintText: 'Study Description' ), validator: (v){ if(v.trim().isEmpty) return 'Please enter Study Description'; return null; }, ),*/ ), SizedBox(width: 10), Flexible( flex: 2, child: DropdownSearch<StudyName>( mode: Mode.BOTTOM_SHEET, isFilteredOnline: true, showClearButton: true, showSearchBox: true, items: studyNamemodel, itemAsString: (StudyName u) => u.studyName, onChanged: (StudyName data) { print(data.studyName); _UpdateFormState.dropdowndata[widget.index] = data.studyName; //FocusScope.of(context).nextFocus(); }, maxHeight: 300, onFind: (String filter) => getData(filter), label: "Study Name", ), ), ], );
For further reference, I had already posted this on stackoverflow here is the link
The text was updated successfully, but these errors were encountered: