ExpansionTile and SingleChildScrollView not working together in Flutter?

Viewed 35

How can I avoid the overflowing in my text when using ExpansionTile widget? When I was not using this widget my text was not overflowing and using SingleChildScrollView was enough.

ExpansionTile(
    title: Text('History'),
    children: [
        SingleChildScrollView(
            child:Text(widget.descriptionText as String),
        ),
    ]
)
1 Answers

A single child scroll view can take infinite height if not bound. You can try wrapping it with a sizedBox of specific height

ExpansionTile(
    title: Text('History'),
    children: [
      SizedBox(
        height: 500,
        width: MediaQuery.of(context).size width*0.7,
        child: SingleChildScrollView(
            child:Text(widget.descriptionText as String),
        ),
    )
    ]
)
Related