консоль:
Код: Выделить всё
{
title: 'One more try',
ingredients: [ '["Ingredient A","Ingredient B", "sweet"]' ],
instructions: 'I don't know.',
imageUrl: [],
difficulty: 'Medium ',
time: '36',
servings: 5,
_id: new ObjectId('667f225ccc58dfb1e42a20cf'),
createdAt: 2024-06-28T20:51:40.117Z
}
На контроллере var elements = [].obs;
В представлении:
Код: Выделить всё
TextField(
onChanged: (value) {
controller.ingredients.value = value.split(',');
},
decoration: const InputDecoration(
labelText: 'Ingredients (comma separated)'),
),)
Значение типа «String» не может быть присвоен переменной типа List
Подробнее здесь: https://stackoverflow.com/questions/786 ... ode-js-api
Мобильная версия