У меня есть изображение в верхней части виджета Column, после этого есть заголовок, который является текстовым виджетом, а после этого есть еще один текстовый виджет, который содержит некоторое описание, выходит за пределы экрана и дает ошибку рендеринга.
Поэтому я хочу сделать это текстовое представление прокручиваемым, чтобы оно было полностью видимым и прокручиваемым. И его размер должен быть динамическим, как и данные, поступающие из API. Я пробовал несколько подходов, но не смог. Вот скриншот
Скриншот:
@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,
),
),
),
],
),
);
}