Let’s say this is your Textfield
TextField(
keyboardType: TextInputType.multiline,
maxLines: 10,
);
You can get its value by adding a type controller TextEditingController
, or simply by adding a callback
methodically onChanged
, to facilitate things we will add to callback
TextField(
keyboardType: TextInputType.multiline,
maxLines: 10,
onChanged: (novoTexto) {}
);
As already suggested by João Monteiro’s reply, you need to make a split in the variable that contains your text, which in your case would be per line, for this you can use the character \n
, are would be:
onChanged: (novoTexto) {
var lista = novoTexto.split('\n');
}
So every time your input value changes, the method onChanged
will be called with the function you passed, within this you are "divined" the text in a list of texts, each entry of this list corresponds to a line of text;
Your question got a little confused... Do you want to, for example, type something in Textfield and when you click a button, insert the record in a list? If you give us an example of what you have already done we can help you, because if it is as I said, it is possible yes and very simple.
– Matheus Ribeiro