我正在嘗試在我的小部件中創建框,該框將根據其中發布的內容動態調整大小,但是當它達到溢位時它似乎被截斷了。
Padding _buildReviewsSnapshot(Tasker user) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 5.0),
child: Row(
children: [
Expanded(
// flex: 3,
child: GridView.count(
crossAxisCount: 2,
shrinkWrap: true,
children: List.generate(6, (index) {
return Container(
decoration: BoxDecoration(
border: Border.all(
color: const Color.fromRGBO(212, 221, 230, 1)),
borderRadius:
const BorderRadius.all(Radius.circular(20))),
margin: const EdgeInsets.all(6),
clipBehavior: Clip.antiAlias,
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Column(children: [
Row(children: const [
Icon(
Icons.star_rate,
size: 16,
color: Colors.amber,
),
Icon(
Icons.star_rate,
size: 16,
color: Colors.amber,
),
Icon(
Icons.star_rate,
size: 16,
color: Colors.amber,
),
Icon(
Icons.star_rate,
size: 16,
color: Colors.amber,
),
Icon(
Icons.star_border,
size: 16,
color: Colors.grey,
),
]),
const SizedBox(height: 10),
Text(
"Charlee wasn’t present at the job but we had extremely clear instructions on what to do and how to do it. Would highly recommend as the attention to detail was spot on",
style: Theme.of(context).textTheme.bodyText1),
Text("- Charlee R",
style: Theme.of(context).textTheme.bodyText2),
]),
));
}),
)),
],
));
}
uj5u.com熱心網友回復:
試試下面的代碼希望對你有幫助。有兩種顯示輸出的方式
如果您顯示內容的全文,您可以使用
SingleChildScrollView()Wrap yourColumn()inside SingleChildScrollView() 請參閱
Text在
uj5u.com熱心網友回復:
您可以使用“靈活”使容器根據其內容改變其大小
*編輯看起來好像弄錯了,抱歉。嘗試更改
Flexible我之前提到的并將其更改為Wrap小部件。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/377667.html下一篇:APK構建失敗
