Reputation: 2380
This code crashes when run and won't render the Listview or the textfield:
return Scaffold(
floatingActionButton : FloatingActionButton(
child : Icon(Icons.add, color : Colors.white),
onPressed : () async {
contactsModel.entityBeingEdited = Contact();
contactsModel.setStackIndex(1);
}
),
body :
Column( children: <Widget> [
Padding(
padding: EdgeInsets.all(3.0),
child:
TextField(
controller: searchController,
decoration: InputDecoration(
icon: Icon(Icons.search),
hintText: "search text",
border: OutlineInputBorder()
), //decoration
), //textfield
), // padding
Expanded(
child:
ListView.builder(
itemCount : contactsModel.entityList.length,
itemBuilder : (BuildContext inBuildContext, int inIndex) {
Contact contact = contactsModel.entityList[inIndex];
return Column(
children : [
Slidable(
delegate : SlidableDrawerDelegate(),
actionExtentRatio : .25,
child : ListTile(
title : Text("${contact.name}"),
subtitle : contact.pwordHint == null ? null : Text("${contact.pwordHint} - ${contact.notes}"),
// Edit existing contact.
onTap : () async {
// Get the data from the database and send to the edit view.
contactsModel.entityBeingEdited = await ContactsDBWorker.db.get(contact.id);
contactsModel.setStackIndex(1);
}
),
secondaryActions : [
IconSlideAction(
caption : "Delete",
color : Colors.red,
icon : Icons.delete,
onTap : () => _deleteContact(inContext, contact)
)
]
),
Divider()
]
); /* End Column. */
} /* End itemBuilder. */
), /* End ListView.builder. */
),
],
),
); /* End Scaffold. */
Error:
Vertical viewport was given unbounded height.
Upvotes: 1
Views: 46
Reputation: 267524
Try wrapping your Slideable inside SizedBox
like this.
SizedBox(
height: 100,
child: Slideable(...),
)
Upvotes: 2