繁体   English   中英

Flutter 较小设备上的渲染溢出底部问题

[英]Flutter render overflow bottom issue on smaller devices

我的应用程序中有一个警报对话框,它来自初始化元素。 表单包裹着一个列小部件。 然而,当键盘打开时,它会抛出底部溢出问题。 为了解决这个问题,我使用singlechildScrollview包装了该列。 这解决了这个问题。 但是当我在一个较小的设备上打开它时,它会抛出底部溢出错误,甚至用singlechildScrollview包裹。 目前,该问题存在于较小的设备上。 代码如下

Get.defaultDialog(
      title: 'Have any Issues?',
      titleStyle: Theme.of(Get.context!).textTheme.headline5,
      content: SafeArea(
        child: SingleChildScrollView(
          reverse: true,
          scrollDirection: Axis.vertical,
          physics: const ClampingScrollPhysics(),
          child: Column(
            children: [
              Padding(
                padding:  EdgeInsets.only(bottom:bottom),
                child: Text(
                  paymentIssueMessage,
                  textAlign: TextAlign.center,
                  style: Theme.of(context).textTheme.bodyText1,
                ),
              ),
              const SizedBox(
                height: 10,
              ),
              TextFormField(),
              TextFormField()    // Fields in form
              ]
             )
            )
           )

如何在小屏幕设备上解决这个问题??

在此处输入图像描述

添加如下所示的灵活小部件或扩展小部件。

Column(
        children: [
          Padding(
            padding:  EdgeInsets.only(bottom:bottom),
            child: Text(
              paymentIssueMessage,
              textAlign: TextAlign.center,
              style: Theme.of(context).textTheme.bodyText1,
            ),
          ),
          const SizedBox(
            height: 10,
          ),
          TextFormField(),
          TextFormField()
        ].map((e) => Flexible(child: e)).toList(),
      )

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM