Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
339 views
in Technique[技术] by (71.8m points)

The keyboard comes in front of the flutter HTML editor -FLUTTER

My problem is that the Keyboard comes in front of the HTML text editor widget when the keyboard opens. I make the whole page scrollable when the keyboard opens. it works on normal text fields, text area widgets but not works on flutter Html editor. Can anyone suggest a solution for this?

This is the screenshot of the issue. 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,
        )
      ),
    ],
  ),
);

This is my code


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try wrapping the html editor inside a Container and setting the margin to MediaQuery.of(context).viewInsets. Like this:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...