1
I’m trying to create this layout for an app, I used an Expansion Tile inside a Card and a listview below, but when I open the expansionTile, if hitting the bottom of the screen happened that and if the listview has many Iles happens that, I’m not getting any way to solve this problem.
Follow my code below:
class HomeState extends State<Teste>{
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text (""),
),
body: Container(
padding: EdgeInsets.all(15.0),
child: Column(
children: <Widget>[
CardList(),
MyList()
],
),
),
);
}
}
Widget CardList(){
return new Flexible(
child: Card(
elevation: 5,
color: Color.fromARGB(255, 0xC8, 0xF4, 0xF2),
child: ExpansionTile(
title: Text("Periodo",
style: new TextStyle(
),textAlign: TextAlign.center,
),
children: <Widget>[
ListaPeriodos(10)
],
),
)
);
}
Widget MyList(){
return new ListView.builder(
padding: EdgeInsets.all(10.0),
shrinkWrap: true,
itemBuilder: (BuildContext context, int index) {
return new ListTile(
title: new Text(
"Texto",
textAlign: TextAlign.center,
style: new TextStyle(
fontWeight: FontWeight.normal,
color: Colors.black45
),
),
);
},
itemCount: 15,
);
}
From what I understand your content is overflowing the possible screen size. Try to put your Widgets tree in a Singlechildscrollview().
– Leonardo Paim
Thanks, I did that and it worked visually, but now I can’t roll the page, only if I run my finger through the edge of the screen. My idea is that this Ile expander is fixed on the screen, while the list below is scrollable, the list options will be shown according to what is selected in the Ile expander.
– pksasso
Got it, in case your full screen content might be "scrolled" isn’t that it? and in case the tile and the list is larger than the screen you will make the "scroll" in the two widgets? Because I kept thinking about your layout and I think that the selector you presented would be with the best content presented in a Dialog that displays your options. So only the list would have scroll. Here is the suggestion.
– Leonardo Paim