Flutter: динамическое добавление значений на сложную карту - PullRequest
1 голос
/ 17 июня 2020

На карте

Map test = {};

Каким образом можно добавлять значения из события textFields onChanged:

onChanged: (value) {  
    // This is the onChanged Method of quantity textField            
    test['$index'] = ? /* This is the V/K 'qty': value */
},

У меня есть еще два texFields:

onChanged: (value) {  
        // This is the onChanged Method of element1 textField            
        test['$index'] = ? /* This is theV/K 'el1': value */
    },

И:

onChanged: (value) {  
            // This is the onChanged Method of element2 textField           
            test['$index'] = ? /* This is theV/K 'el2': value */
        },

Это последняя желаемая карта:

{
    0: {qty: 100, el1: element1, el2: element2}, 
    1: {qty: 200, el1: element1, el2: element2}, 
    2: {qty: 300, el1: element1, el2: element2}
}

Где 0,1,2 ... N - индексы

Я навсегда ценю любую помощь или совет

...