I have an image at the top of a Column widget after that there is heading which is Text widget and after that, there is one more Text widget which contains some description and that exceeds the screen and gives an error of rendering.
So I want to make that text view scrollable, so that it should be visible completely and scrollable too. And its size must be dynamic as the Data coming from API. I tried few of the approaches but unable to make it done. Here is the screenshot
Screenshot:
@override
Widget build(BuildContext context) {
var size = MediaQuery
.of(context)
.size;
final double itemHeight = (size.height - kToolbarHeight - 24) / 2;
final double itemWidth = size.width;
return new Container(
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Padding(
padding: const EdgeInsets.fromLTRB(0.0, 24.0, 0.0, 0.0),
child: new Image.asset(
'assets/img/noconnection.png',
height: 200.0,
width: itemWidth,
),
),
new Padding(
padding: const EdgeInsets.all(12.0),
child: new Text(
"Some Heading Text",
style: new TextStyle(
fontSize: 28.0,
color: Colors.black87,
fontWeight: FontWeight.w600),
),
),
new SingleChildScrollView(
child: new Text(
"Description that is too long in text format(Here Data is coming from API)",
style: new TextStyle(
fontSize: 16.0, color: Colors.black87,
),
),
),
],
),
);
}