I need to insert a textformfield at the bottom of my page with a button on the right. On this page and inside the build widget, I have a listview with a fixed size and I want a text to be entered at the end.
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Mensajes de trabajo"),
backgroundColor: Colors.deepOrange,
),
body: Container(
height: 450,
child: FutureBuilder(
future: _capturaComuna(),
builder: (BuildContext context, AsyncSnapshot snapshot){
if (snapshot.data == null){
return Container(
child: Center(
child: Text("Cargando...")
)
);
} else {
return ListView.builder(
itemCount: snapshot.data.length,
itemBuilder: (BuildContext context, int index) {
return Card(
child: ListTile(
leading: CircleAvatar(
backgroundImage: NetworkImage(snapshot.data[index].imagen_mensaje),
),
title: new Text(snapshot.data[index].nombre_persona + ' ' + snapshot.data[index].fecha_mensaje),
subtitle: Text(snapshot.data[index].texto_mensaje),
)
);
},
);
}
}
)
)
);
}
Here I made an example of how it should be, using
MediaQuery
so you don't have to put a fixed size on theContainer
, just replace with your snapshot.With this, when the keyboard appears it pushes your bottom bar so you can see what you are entering in the TextField.