记录flutter ListView卡顿的一种情况

记录flutter ListView卡顿的一种情况

如果ListView是用的children[]方式,快速滑动会卡顿
建议使用SingleChildScrollView

ListView(
                        physics: const NeverScrollableScrollPhysics(),
                        shrinkWrap: true,
                        children: [
                          //姓名
                          const CommonLabel(text: "Là mục bắt buộc nhập"),
                          Padding(padding: EdgeInsets.only(top: 10.h)),
                          CommonInput(
                            hint: "Nhập tên đầy đủ ",
                            type: TextInputType.text,
                            visible: true,
                            controller: _nameController,
                          ),
                          Padding(padding: EdgeInsets.only(top: 10.h)),

                          //身份证
                          CommonInput(
                            hint: "Nhập số CMND/ CCCD ",
                            type: TextInputType.number,
                            visible: true,
                            controller: _idCardNumberController,
                          ),
                          Padding(padding: EdgeInsets.only(top: 10.h)),

                          //出生日期
                          CommonSelect(
                            visible: true,
                            hint: "Ngày sinh ",
                            selectedValue: _birthdayValue,
                            onPress: () {
                              _showTimePicker();
                            },
                          ),
                          Padding(padding: EdgeInsets.only(top: 10.h)),

                          _checkBoxView(),

                          //教育程度
                          const CommonLabel(
                              text: "Vui lòng chọn trình độ học vấn "),
                          Padding(padding: EdgeInsets.only(top: 10.h)),
                          CommonSelect(
                            hint: "Vui lòng chọn",
                            selectedValue: _educationName,
                            onPress: () {
                              _disFocus();
                              if (_eductionData.isNotEmpty) {
                                _showMyPicker(_eductionData, StepStatus.EDUCATION);
                              }
                            },
                          ),
                          Padding(padding: EdgeInsets.only(top: 10.h)),
SingleChildScrollView(
                  physics: const BouncingScrollPhysics(),
                  child: Column(
                    /*  padding: EdgeInsets.only(left: 10.w, right: 10.w),*/
                    children: [
                      Padding(
                          padding: EdgeInsets.only(left: 17.w, right: 17.w),
                          child: Image.asset(
                            "assets/images/p1_2.png",
                            height: 61.h,
                            width: 306.w,
                          )),
                      Padding(
                        padding: EdgeInsets.only(
                            top: 22.5, left: 2.5.w, right: 2.5.w),
                        child: Image.asset("assets/images/p1_1.png"),
                      ),
                      Padding(padding: EdgeInsets.only(top: 25.h)),
                      const CommonText(text: " Là mục bắt buộc nhập"),
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值