微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

键盘出现在 flutter HTML 编辑器 -FLUTTER 之前

如何解决键盘出现在 flutter HTML 编辑器 -FLUTTER 之前

我的问题是当键盘打开时,键盘出现在 HTML 文本编辑器小部件的前面。当键盘打开时,我使整个页面可滚动。它适用于普通文本字段、文本区域小部件,但不适用于 Flutter Html 编辑器。任何人都可以为此提出解决方案吗?

这是问题的截图。

Image attached shows the issue

 return Container(
  margin: EdgeInsets.only(
    top: 14,),child: Column(
    crossAxisAlignment: CrossAxisAlignment.start,mainAxisAlignment: MainAxisAlignment.start,children: <Widget>[
      Container(
        margin: EdgeInsets.only(
            left: SizeConfig.safeBlockVertical * 1.5,top: 14),child: Text(
          "Enter Message",style: TextStyle(
              fontSize: 14,fontFamily: 'UbuntuRegular',color: MyColor.textColor),Container(
        margin: EdgeInsets.only(
            top: SizeConfig.safeBlockVertical * 3,right: SizeConfig.safeBlockVertical * 1),padding: EdgeInsets.only(
          left: SizeConfig.safeBlockHorizontal * 3,right: SizeConfig.safeBlockHorizontal * 3,bottom: SizeConfig.safeBlockHorizontal * 3,child: HtmlEditor(
          hint: "Your text here...",key: keyEditor,height: 400,useBottomSheet: false,showBottomToolbar: false,)
      ),],);

这是我的代码

解决方法

尝试将 html 编辑器包装在 Container 中并将 margin 设置为 MediaQuery.of(context).viewInsets。像这样:

Container(child: YourHtmlEditor(),margin: MediaQuery.of(context).viewInsets,)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。