Comments (10)
I have cloned and edited somethings on the the project and made the change to this initialValue. I will send a pull request tomorrow after I get a working test for the widget later today. Again many thanks.
from flutter_multiselect.
@SlimenTN Please use
initialValue: [1,3]; // for setting initial values
The full code goes like this -
MultiSelect(
autovalidate: false,
titleText: "Paramédicaux",
dataSource: [
{
"display": "Dorsaf Mansouri",
"value": 1,
},
{
"display": "Imed Trabelsi",
"value": 2,
},
{
"display": "Maha Jandoubi",
"value": 3,
},
],
hintText: "Appuyez pour sélectionner un ou plusieurs",
textField: 'display',
valueField: 'value',
filterable: true,
required: true,
initialValue: [1,3],
value: null,
onSaved: (value) {
print('The value is $value');
}
)
from flutter_multiselect.
@SlimenTN right now the text is hardcoded in some place. I am in process of giving those options to user. Stay tuned for next release
from flutter_multiselect.
@randaleWatson Thanks for your feedback.
Right now the widget support passing the initial values but instead of initialValue it uses value property.
So, the example that we have can be something like below
MultiSelect(
...
...
...
value: [2,3] // instead of null
)
But I take your suggestion and will make it more uniform to other standard form fields.
Apart from this I have more updates to be pushed for this widget.
Thank you once again for using it and posting your feedback.
from flutter_multiselect.
How to implement prefill selected item in MultiSelect Widget and also display prefill value in widget?
from flutter_multiselect.
I have cloned and edited somethings on the the project and made the change to this initialValue. I will send a pull request tomorrow after I get a working test for the widget later today. Again many thanks.
Can you help me for prefill value ?
from flutter_multiselect.
I have set value: [1,3],
but it's not working, this is my code:
MultiSelect(
autovalidate: false,
titleText: "Paramédicaux",
dataSource: [
{
"display": "Dorsaf Mansouri",
"value": 1,
},
{
"display": "Imed Trabelsi",
"value": 2,
},
{
"display": "Maha Jandoubi",
"value": 3,
},
],
hintText: "Appuyez pour sélectionner un ou plusieurs",
textField: 'display',
valueField: 'value',
filterable: true,
required: true,
value: [1,3],
onSaved: (value) {
print('The value is $value');
}
)
Still get an empty view, nothing is selected !
from flutter_multiselect.
@hiddencaliber I get this error:
The argument type 'List<int>' can't be assigned to the parameter type 'int'.
initialValue is and interger not a List
MultiSelect(
{FormFieldSetter<dynamic> onSaved,
FormFieldValidator<dynamic> validator,
int initialValue,
....
from flutter_multiselect.
@hiddencaliber sorry my bad I have to upgrade to version 0.4.0
from flutter_multiselect.
@hiddencaliber did this package support multi language ?
i want to user french instead of english.
from flutter_multiselect.
Related Issues (20)
- Dynamic List HOT 3
- Provide images or gifs about the package HOT 2
- Reset / clear selection HOT 5
- Change 'Save' and 'Cancel' button text language HOT 2
- Onsaved is not working HOT 8
- Select and deselect all HOT 4
- Bad state: Too many elements HOT 5
- Eliminate hardcoded colors, looks partially unreadable with dark theme. HOT 6
- Could not call onSaved: (value) HOT 3
- jump screen selected itens HOT 2
- How change the bar color HOT 4
- OnSaved not saving the values HOT 5
- unable to change appbar color
- Class 'BuildingModel' has no instance method '[]' HOT 5
- setState inside _onSaved returns error HOT 2
- onSaved method is not working
- Provide selected items text color change HOT 1
- It is not NULL SAFETY HOT 2
- [Issue] Button Save not enabling after update to 1.0.0 HOT 4
- How do I change font style ?
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 flutter_multiselect.