0
My question is as follows: When placing the employee id and clicking add, enter the employee id and name in the list, as in the photo:
When adding, the contributor overwrites the textfield...
I’m trying to keep the text field below the last item on the list.
It is a simple listview and a simple textfield. It follows the code
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: listaUsers.length,
itemBuilder: (context, index) {
return ListTile(
dense: true,
title: Row(
children: <Widget>[
Text(
listaUsers[index]
.id
.toString(),
style: TextStyle(color: Colors.black, fontSize: 13),
),
Text(" - "),
Text(
listaUsers[index].name,
style: TextStyle(color: Colors.black, fontSize: 13),
),
],
),
onTap: () => _onTapped(user),
trailing: IconButton(
icon: Icon(Icons.remove),
onPressed: () {},
)
);
}),
Padding(
padding: EdgeInsets.only(left: 10),
child: Container(
padding: EdgeInsets.only(left: 15, right: 15),
child: Row(children: <Widget>[
Expanded(
child: TextField(
controller: addColaborador,
decoration: InputDecoration(
hintText: "ID COLABORADOR",
contentPadding: EdgeInsets.only(bottom: 0),
labelStyle: TextStyle(color: Colors.blueAccent)
),
),
),
IconButton(
icon: Icon(Icons.add),
onPressed: () {
_buscarId();
},
)
]
)
)
)