dart 如何改变这种设计并排?

lmyy7pcs  于 2023-04-09  发布在  其他
关注(0)|答案(1)|浏览(112)

如何改变这种设计并排?我试图使用容器,列,和行部件.但在我插入的小部件行设计它不会出来,屏幕冻结.我希望有人可以帮助我
验证码:

const SizedBox(height: 20),
                                const Align(
                                  alignment: Alignment.centerLeft,
                                  child: Text(
                                    "My Vitals",
                                    textAlign: TextAlign.right,
                                    style: TextStyle(
                                        fontSize: 20,
                                        height: 1.4,
                                        fontWeight: FontWeight.w500),
                                  ),
                                ),
                                SizedBox(
                                  height: 15,
                                ),
                                _bloodPressureLatest.isNotEmpty
                                    ? bloodPressureLatest(    <= Function for bloodPressure design
                                        context,
                                        checkBloodPressureReadingStatus(
                                            double.parse(_bloodPressureLatest[0]
                                                ["bloodPressure"]["systolic"])),
                                        _bloodPressureLatest[0]["bloodPressure"]
                                                ["systolic"] ??
                                            "0",
                                        _bloodPressureLatest[0]["bloodPressure"]
                                                ["diastolic"] ??
                                            "0",
                                        _bloodPressureLatest[0]
                                                ["recordTimestamp"] ??
                                            _timestamp)
                                    : bloodPressureLatest(
                                        context, 0, "0", "0", _timestamp),
                                _heartRateLatest.isNotEmpty
                                    ? heartRateLatest(  <= Function for heart rate design
                                        context,
                                        _heartRateLatest,
                                        _heartRateLatest[0]["vitalValue"],
                                        _heartRateLatest[0]["recordTimestamp"])
                                    : heartRateLatest(
                                        context, [], "0"
vc9ivgsu

vc9ivgsu1#

在SizedBox()中 Package 你的元素,并给予它一个宽度。比如:

Row(
 children: [
  SizedBox(
   width: 200,
   child: bloodPressureLatest(...),
  ),
  SizedBox(
   width: 200,
   child: heartRateLatest(...),
  ),
 ],
),

相关问题