Giter Club home page Giter Club logo

Comments (10)

randaleWatson avatar randaleWatson commented on August 19, 2024 1

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.

hiddencaliber avatar hiddencaliber commented on August 19, 2024 1

@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.

hiddencaliber avatar hiddencaliber commented on August 19, 2024 1

@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.

hiddencaliber avatar hiddencaliber commented on August 19, 2024

@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.

nikhil-concetto avatar nikhil-concetto commented on August 19, 2024

How to implement prefill selected item in MultiSelect Widget and also display prefill value in widget?

from flutter_multiselect.

nikhil-concetto avatar nikhil-concetto commented on August 19, 2024

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.

SlimenTN avatar SlimenTN commented on August 19, 2024

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.

SlimenTN avatar SlimenTN commented on August 19, 2024

@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.

SlimenTN avatar SlimenTN commented on August 19, 2024

@hiddencaliber sorry my bad I have to upgrade to version 0.4.0

from flutter_multiselect.

SlimenTN avatar SlimenTN commented on August 19, 2024

@hiddencaliber did this package support multi language ?
i want to user french instead of english.

from flutter_multiselect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.