屏幕上显示了一个灰色的框.它未处于调试模式. 只有当我切换到释放模式时,才会出现一个灰色的框.
是什么导致了这个问题?我要怎么改变呢?
itemInfoWidget() {
return Container(
height: MediaQuery.of(Get.context!).size.height * 0.55,
width: MediaQuery.of(Get.context!).size.width,
decoration: const BoxDecoration(
color: Colors.black38,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
boxShadow: [
BoxShadow(offset: Offset(0, 0), blurRadius: 0, color: Colors.green),
]),
padding: const EdgeInsets.symmetric(horizontal: 16),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(
height: 18,
),
Center(
child: Container(
height: 8,
width: 130,
decoration: BoxDecoration(
color: Colors.black38,
borderRadius: BorderRadius.circular(
(30),
)),
),
),
const SizedBox(
height: 18,
),
//name
Row(
children: [
Text(
widget.itemInfo!.name!,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 25
),
),
const Spacer(),
Obx(() => IconButton(
onPressed: () {
if (itemDetailsController.isFavorite == true) {
//delete item from favorites
deleteItemFromFavoriteList();
} else {
//save item to user favorites
addItemToFavoriteList();
}
},
icon: Icon(
itemDetailsController.isFavorite
? CupertinoIcons.bookmark_fill
: CupertinoIcons.bookmark,
color : const Color(0xffffd400),
size: 25,
),
)),
],
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.01,
),
//rating + rating num, tags, price
Row(
children: [
const SizedBox(height: 30),
//rating
RatingBar.builder(
initialRating: widget.itemInfo!.rating!,
minRating: 1,
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
itemBuilder: (context, c) => const Icon(
Icons.star,
color: Colors.amber,
),
onRatingUpdate: (updateRating) {},
ignoreGestures: true,
unratedColor: Colors.black87,
itemSize: 20,
),
const SizedBox(
width: 8,
),
// rating num
Text(
"(${widget.itemInfo!.rating})",
style: const TextStyle(
color: Colors.black87,
fontSize: 18,
),
),
],
),
const SizedBox(height: 10),
//tags
Text(
"카테고리: ${widget.itemInfo!.tags!.toString().replaceAll("[", "").replaceAll("]", "")}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 18,
color: Colors.white,
),
),
const SizedBox(height: 10),
//price
Text(
"포인트: ${widget.itemInfo!.price!}",
style: const TextStyle(
fontSize: 18,
color: Colors.white,
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.03,
),
//모양, 색깔, 재질 박스
// 1줄 넘어가면 재질 박스가 밑으로 이동하도록지(2 rows)
// 1줄 안에 다 들어가면 1 row 유지하는 방법..?
Center(
child: Wrap(
// 20221229
alignment: WrapAlignment.center,
spacing: 7,
runSpacing: 8,
children: [
//색깔 박스
Row(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
"색깔",
style: TextStyle(
fontSize:
16,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 2),
...List.generate(widget.itemInfo!.colors!.length,
(index) {
return Container(
// height: 35,
padding: const EdgeInsets.symmetric(
vertical: 4, horizontal: 8),
margin: const EdgeInsets.symmetric(horizontal: 2),
// width: widget.itemInfo!.colors![index]
// .replaceAll("[", "")
// .replaceAll("]", "") ==
// '얼룩덜룩한'
// ? MediaQuery.of(context).size.width * 0.26
// : MediaQuery.of(context).size.width * 0.15,
decoration: const BoxDecoration(boxShadow: [
BoxShadow(
offset: Offset(1, 1),
blurRadius: 2,
color: Colors.black38),
], color: Color(0xff073215)),
alignment: Alignment.center,
child: Text(
widget.itemInfo!.colors![index]
.replaceAll("[", "")
.replaceAll("]", ""),
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 16,
color: Colors.white,
),
),
);
}),
const SizedBox(width: 3),
],
),
const Spacer(),
Row(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
"모양",
style: TextStyle(
fontSize: 16,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 2),
...List.generate(widget.itemInfo!.shapes!.length,
(index) {
return Container(
// height: 35,
padding: const EdgeInsets.symmetric(
vertical: 4, horizontal: 8),
margin: const EdgeInsets.symmetric(horizontal: 2),
// width: MediaQuery.of(context).size.width * 0.15,
decoration: const BoxDecoration(boxShadow: [
BoxShadow(
offset: Offset(1, 1),
blurRadius: 2,
color: Colors.black38),
], color: Color(0xff073215)),
alignment: Alignment.center,
child: Text(
widget.itemInfo!.shapes![index]
.replaceAll("[", "")
.replaceAll("]", ""),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 16,
color: Colors.white,
),
),
);
}),
const SizedBox(width: 2),
],
),
const Spacer(),
Wrap(children: [
Row(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
"재질",
style: TextStyle(
fontSize: 16,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 2),
...List.generate(widget.itemInfo!.materials!.length,
(index) {
return Container(
// height: 35,
padding: const EdgeInsets.symmetric(
vertical: 4, horizontal: 8),
margin: const EdgeInsets.symmetric(horizontal: 2),
// width: widget.itemInfo!.materials![index]
// .replaceAll("[", "")
// .replaceAll("]", "") ==
// '깍지벌레' ||
// widget.itemInfo!.materials![index]
// .replaceAll("[", "")
// .replaceAll("]", "") ==
// '거미줄'
// ? MediaQuery.of(context).size.width * 0.23
// : MediaQuery.of(context).size.width * 0.15,
decoration: const BoxDecoration(boxShadow: [
BoxShadow(
offset: Offset(1, 1),
blurRadius: 2,
color: Colors.black38),
], color: Color(0xff073215)),
alignment: Alignment.center,
child: Text(
widget.itemInfo!.materials![index]
.replaceAll("[", "")
.replaceAll("]", ""),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 16,
color: Colors.white,
),
),
);
}),
],
),
]),
],
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.025,
),
//description
const Text(
"특징: ",
style: TextStyle(
fontSize: 18,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.005,
),
Text(
widget.itemInfo!.description!,
textAlign: TextAlign.justify,
style: const TextStyle(
fontSize: 18,
color: Colors.white70,
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.035,
),
//관찰 올리기 - 버튼
Material(
elevation: 4,
color: const Color(0xffBF5F27),
borderRadius: BorderRadius.circular(10),
child: InkWell(
onTap: () {
Get.to(() => UserUploadReviewsScreen(
itemInfo: widget.itemInfo,
));
},
borderRadius: BorderRadius.circular(20),
child: Container(
alignment: Alignment.center,
height: 50,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Icon(
CupertinoIcons.camera_fill,
color: Colors.white,
),
SizedBox(
width: 15,
),
Text("관찰 올리기",
style: TextStyle(
fontSize: 18,
color: Colors.white,
)),
],
),
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.035,
),
],
),
),
);
}
我想展示里面的东西,而不是一个灰色的盒子.