I have below code in flutter.
Widget build(BuildContext context) {
return Center(
child: Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Row(
children: <Widget>[
SizedBox(
height: 100,
child: ListTile(
leading: IconButton(
iconSize: 30,
icon: roundImage(post.userPicture, Icon(Icons.person)),
onPressed: () {},
),
subtitle: Text(this.post.message),
)),
],
),
],
),
),
);
}
But I get this error:
════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: RenderPhysicalShape#7713c relayoutBoundary=up3
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1687 pos 12: 'hasSize'
The relevant error-causing widget was
Card
I have added SizedBox
in the Row
but it still complains about hasSize
error. How can I solve this issue?
It's not clear what you're trying to achieve, but instead of using SizedBox
you can try wrapping inside Expanded
or Flexible
widgets.
Add Flexible
Row(
children: [
new Flexible(
child: new TextField(
decoration: const InputDecoration(helperText: "Enter App ID"),
style: Theme.of(context).textTheme.body1,
),
),
],
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With