[英]A RenderFlex overflowed by 224 pixels on the bottom
How to fix the following error?如何修复以下错误?
A RenderFlex overflowed by 224 pixels on the bottom.一个 RenderFlex 在底部溢出了 224 个像素。
on the Column widget在列小部件上
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Read message'),
),
body: Column( //the error is here
children: [
Padding(
padding: const EdgeInsets.all(20.0).copyWith(bottom: 10),
child: Row( ...
Wrap your Column
with a SingleChildScrollView
用SingleChildScrollView
包裹你的Column
Depending on the device screen, these widgets can overflow, there are few solutions to handle it.根据设备屏幕,这些小部件可能会溢出,处理它的解决方案很少。
SingleChildScrollView( child: Column(children: children), ) SingleChildScrollView(子:列(子:子),)
ListView( children: children ) ListView(儿童:儿童)
Column( children: [...children.take(2).toList(), // show first 2 children in Column Expanded( child: ListView( children: children.getRange(3, children.length).toList(), ), // And rest of them in ListView ), ], ) Column( children: [...children.take(2).toList(), // 显示 Column Expanded(child: ListView( children: children.getRange(3, children.length).toList(), 中的前 2 个子项) ), // 以及 ListView 中的 rest ), ], )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.