'How to stretch in height column
I am trying to make my column fill in height the rest of empty space, I tried using flexible, sizedbox etc. but I keep getting this error. Am I doing something wrong?
RenderBox was not laid out: RenderDecoratedBox#b1e29 relayoutBoundary=up1
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1982 pos 12: 'hasSize'
Padding(
padding: const EdgeInsets.all(8.0),
child: SizedBox(
height: double.infinity,
child: Column(
children: [
Text(widget.name,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold),
maxLines: 2,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis),
const SizedBox(height: 8.0),
Container(
child: SingleChildScrollView(
child: Text(
widget.description,
style: const TextStyle(
fontSize: 16.0)),
),
),
],
),
),
),
Solution 1:[1]
Try below code hope its help to you.
Padding(
padding: const EdgeInsets.all(8.0),
child: SizedBox(
height: double.infinity,
child: SingleChildScrollView(
child: Column(
children: [
Text(
widget.name,
style:
const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
maxLines: 2,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 8.0),
Container(
child: Text(
widget.description,
style: const TextStyle(fontSize: 16.0),
),
),
],
),
),
),
),
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ravindra S. Patil |
