[英]Flutter app show grey screen in release mode but works fine in debug mode
[英]Flutter - A screen is grey in release build, but works fine when run from Android Studio
發生這種情況是因為某些小部件未正確呈現。
在 android studio 中檢查應用程序日志以及相關的錯誤。
我遇到了同樣的問題。 該應用程序在調試模式下運行良好,但某些小部件存在一些問題並以灰色顯示。
解決方案是刪除包裹在 Column 上的 Expanded 小部件
Expanded(
flex: 5,
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 30),
child: Container(
child: Align(
alignment: Alignment.centerLeft,
child: Column(
children: [
Text(
"Peramangalam House",
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: kTextColor),
),
Text(
"Methottuthazham, Kozhikode",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: kTextLightColor),
),
],
),
),
),
),
],
),
),
只是——
Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 30),
child: Container(
child: Align(
alignment: Alignment.centerLeft,
child: Column(
children: [
Text(
"Peramangalam House",
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: kTextColor),
),
Text(
"Methottuthazham, Kozhikode",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: kTextLightColor),
),
],
),
),
),
),
],
),```
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.