adjustEditorHeight method

void adjustEditorHeight({
  1. required double contentHeight,
})

Implementation

void adjustEditorHeight({
  required double contentHeight,
}) {
  var heightChange = contentHeight - _height;
  if (heightChange != 0) {
    setState(() {
      _height = max(contentHeight, widget.minHeight);
    });
    if (widget.controller.scrollController != null && widget.autoAdjustScroll) {
      ScrollController controller = widget.controller.scrollController!;
      if (controller.position.maxScrollExtent > 0) {
        controller.animateTo(controller.offset + heightChange,
            duration: Duration(milliseconds: 200), curve: Curves.ease);
      }
    }
  }
}