hiddencaliber / flutter_multiselect

Flutter package for multi-select UI widget
Other
52 stars 37 forks source link

Onsaved is not working #19

Closed Chuvantinh closed 4 years ago

Chuvantinh commented 4 years ago

I can not get the value of select when I clicked save. The result was printed inner function return InkWell()

hiddencaliber commented 4 years ago

@Chuvantinh Please provide code snippet for same. Thanks,

Chuvantinh commented 4 years ago

Pls help me I have a form inside of Dialog. There,I have integrated a multi select. The Multiselect worked but I can not get value of the select. Hier is function showDialog. _myclock is a List .

code : https://codepen.io/chu-vn-t-nh/pen/JjoMoQE

Chuvantinh commented 4 years ago

Sorry about the code, but I can not put the code in the comment. Something is wrong on Github

Chuvantinh commented 4 years ago

I have posted code in this website

https://codepen.io/chu-vn-t-nh/pen/JjoMoQE

hiddencaliber commented 4 years ago

@Chuvantinh you need to call form's save method after you validate it.

For eg. here if (_formKey.currentState.validate()) { _formKey.currentState.save(); if (note.text != null) {

Chuvantinh commented 4 years ago

Yes I have done it on the line 88 . and on the line 89 I print my value on select but It is always null or []. when I print (print(_myclock);)

ON the line 73 : I do not taken any thing from function onSaved () .

Can you pls help me more ? hier is the code : https://codepen.io/chu-vn-t-nh/pen/JjoMoQE

hiddencaliber commented 4 years ago

@Chuvantinh : You need to call _formKey.currentState.save();, like I said before. onSaved is only called when the form save is triggered

Chuvantinh commented 4 years ago

I didn't read your comment carefully before. Thanks I got it , thank you very much. I close this post .