dropdown button onchanged 
arkadaşlar merhaba. flutterda yeniyim. sqllite tan verilerimi dropdown a aktardıktan sonra onchanged olayında şöyle bir hata alıyorum. yardımcı olabilir misiniz ?  

 exception caught by widgets library   

the following assertion was thrown building futurebuilder<list<kategori>>(dirty, state: \_futurebuilderstate<list<kategori>>#adaa9):  

there should be exactly one item with [dropdownbutton]'s value: instance of ‘kategori’.   

either zero or 2 or more [dropdownmenuitem]s were detected with the same value  

‘package:flutter/src/material/dropdown.dart’:  

failed assertion: line 834 pos 15: ’items == null  items.isempty  value == null ||  

 items.where((dropdownmenuitem<t> item) {  

 return item.value == value;  

 }).length == 1′


bunlarda kodlarım:  

`futurebuilder<list<kategori>>(  

 future: tumkategorigoster(),  

 builder: (context, snapshot) {  

 if (snapshot.hasdata) {  

 return dropdownbutton(  

 hint: text("seçiniz"),  

 value: secilenkategori,  

 items: snapshot.data.map(( value) {  

 return dropdownmenuitem(  

 value: value,  

 child: text(value.kat_ad),  

 );  

 }).tolist(),  

 onchanged: (secilenveri) {  

 setstate(() {  

 secilenkategori = secilenveri;  

 });  

 },  

 );  

 } else {  

 return container();  

 }  

 },  

 ),`
hatayı buldum. tablomdan 2 alan çekip value değerine yazdırmaya çalıştığım için sanırım bu hata oluştu. value: value değerini value: value.kat\_ad olarak duzeltince sorun düzeldi
Resolved:  

  

FORM 1.  

  

Copy Code

```
private void btnModificaContractul\_Click(object sender, EventArgs e)
        {


            string[] IDProdusContractPrelugit = new string[dataProduseContract.Rows.Count];
            string[] IDProdusContractRetras = new string[dataProduseContract.Rows.Count];

            for (int i = 0; i < dataProduseContract.Rows.Count; i++)
            {

                if (Convert.ToBoolean(dataProduseContract.Rows[i].Cells[0].Value) == false)
                {
                    IDProdusContractPrelugit[i] = dataProduseContract.Rows[i].Cells[5].Value.ToString();
                }
                else
                {
                    IDProdusContractRetras[i] = dataProduseContract.Rows[i].Cells[5].Value.ToString();
                }
            }

           

            try
            {
                frmModificaContract ModificareContract = new frmModificaContract(IDProdusContractPrelugit, IDProdusContractRetras);
                ModificareContract.ShowDialog();
            }
            catch { MessageBox.Show("Trebuie să selectaţi un contract din listă pentru a edita.", "Datele furnizate sunt incomplete."); }
           
        }
```
  

  

FORM 2.  

  

Copy Code

```
string[] IDProdusContractPrelugit;
        string[] IDProdusContractRetras;

        public frmModificaContract(string[] IDProdusContractPrelugit, string[] IDProdusContractRetras)
        {
            InitializeComponent();
            this.IDProdusContractPrelugit = IDProdusContractPrelugit;
            this.IDProdusContractRetras = IDProdusContractRetras;
            AfisareProduseContract();
        }


        void AfisareProduseContract()
        {

            foreach (string ContractPrelungit in IDProdusContractPrelugit)
            {
                if (ContractPrelungit != null)
                {
                    Program.Connection.CommandText = "select * from ContractItems WHERE ContractItemId=@ContractItemId";
                    Program.Connection.AddParameter("@ContractItemId", ContractPrelungit);

                    DataTable Table = new DataTable();
                    Program.Connection.FillDataTable(Table, true);


                    for (int i = 0; i < Table.Rows.Count; i++)
                    {
                        if (String.IsNullOrWhiteSpace(Table.Rows[i]["DeletedId"].ToString()))
                        {
                            bool validare;
                            validare = true;

                            dataProduseContract.Rows.Add(validare, Table.Rows[i]["Name"].ToString(), Table.Rows[i]["Quantity"].ToString() + " " + Table.Rows[i]["QuantityUnit"].ToString(), Table.Rows[i]["Payment"].ToString(), Table.Rows[i]["Description"].ToString(), Table.Rows[i]["ContractItemId"].ToString());
                        }
                        else
                        {
                            bool validarescos;
                            validarescos = false;
                            dataProduseContract.Rows.Add(validarescos, Table.Rows[i]["Name"].ToString(), Table.Rows[i]["Quantity"].ToString() + " " + Table.Rows[i]["QuantityUnit"].ToString(), Table.Rows[i]["Payment"].ToString(), Table.Rows[i]["Description"].ToString(), Table.Rows[i]["ContractItemId"].ToString());
                            dataProduseContract.Enabled = false;
                        }

                    }
                }
            }

            
        }
```
  

  

The problem is allwais i have Null value in array. hi andy,  

  

could you please explain in more details what exactly you need to achieve, because i am still not sure i understand you correctly?  

  

please note that when you are using the code below, you are overriding the text of the selected item - in your case this is the first item in the radcombombobox(with the empty text):  


`ddlfuturecode.selecteditem.text =` `"futurecode"`

  

if you want to select an item from the radcombobox by its text, you can use the following code instead:  


`ddlfuturecode.finditembytext(``"futurecode"``).selected =` `true`

  

so the changed vb code should look like the following:  


`dim` `ddlfuturecode` `as` `new` `radcombobox`
 
`with` `ddlfuturecode`
`.items.clear()`
`.items.add(``new` `radcomboboxitem(``""``, 0))`
`.items.add(``new` `radcomboboxitem(``"1"``, 1))`
`.items.add(``new` `radcomboboxitem(``"futurecode"``, 2))`
`.databind()`
`end` `with`
 
`ddlfuturecode.finditembytext(``"futurecode"``).selected =` `true`
 
`form1.controls.add(ddlfuturecode)`

  

  

regards,  

 aneliya petkova   

telerik

do you want to have your say when we set our development plans?
do you want to know when a feature you care about is added or when a bug fixed?
explore the [telerik feedback portal](http://www.telerik.com/support/feedback)
and vote to affect the priority of the items can you try with other dropdowns? if its working , nothing wrong with your code and something to do with that specific drop down. hi sheeeng.  thank you for reporting this to us.  we looked into that file and verified that there is a false detection indeed.  we have fixed this already and the fix should go out soon on the next database releases.

 

thank you again for you report! 

 

 

f-secure labs hey [@andre601](/u/andre601) ! i think there is a webhook that fires for that:

<https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request>

check out the action key in the payload, it has support for state changes between draft and non-draft states. see [creating feedback loops](https://vvvv.org/documentation/creating-feedback-loops).

it’s only the subtype of a datatype. don’t worry about that.

fyi: create an [asstring (value)](https://vvvv.org/documentation/asstring-(value)) and check its sub type for possible subtypes of the datatype “value” hi [@gianna.demetroulakos](/u/gianna.demetroulakos),

as mentioned by [@william.coulson](/u/william.coulson), the object reference not set to an instance of an object normally occurs when a variable is null.

run the code in the debug mode.

when the error occurs, check the variable which has a null value in locals tab.

warm regards,

ranjith u… So since the line of interest is `newBeautifulKiwi.setKiwi(KIWITextField.getText());` and taking into account that `newBeautifulKiwi` can never be null (it has just been created using default constructor) it's `KIWITextField` that is null and thus not inject properly. make sure the id of this element in .fxml file ***exactly*** matches this field's name (I'd made it private).


Most probable cause is `setSettersLose` annotated with @FXML. Check the [similar thread](https://stackoverflow.com/questions/14017542/how-do-i-change-fxml-controller-variable-values-in-javafx-before-showing-window). In your example, the category data is stored in an attribute, rather than within the node itself.


You therefore need to use the XPath: `/product[1]/categories/category/@path` where the @ shows you want to target an attribute. It's hard to do that because each item is not individual, in your example, Gallardo is by itself a subitem of Bull item. If you need to do that, the best attempt i can think about, is to create 2 listviews placed together with BorderStyle=None so they appear as the same and then handle the Drag and Drop event of each one so you can "exchange" items between both lists.



Hope this helps you to solve your need.