ZefyrScope.editable constructor

ZefyrScope.editable(
  1. {@required ZefyrMode mode,
  2. @required ZefyrController controller,
  3. @required FocusNode focusNode,
  4. @required FocusScopeNode focusScope,
  5. ZefyrImageDelegate imageDelegate}
)

Creates editable scope.

Normally used in ZefyrEditor.

Implementation

ZefyrScope.editable({
  @required ZefyrMode mode,
  @required ZefyrController controller,
  @required FocusNode focusNode,
  @required FocusScopeNode focusScope,
  ZefyrImageDelegate imageDelegate,
})  : assert(mode != null),
      assert(controller != null),
      assert(focusNode != null),
      assert(focusScope != null),
      isEditable = true,
      _mode = mode,
      _controller = controller,
      _imageDelegate = imageDelegate,
      _focusNode = focusNode,
      _focusScope = focusScope,
      _cursorTimer = CursorTimer(),
      _renderContext = ZefyrRenderContext() {
  _selectionStyle = _controller.getSelectionStyle();
  _selection = _controller.selection;
  _controller.addListener(_handleControllerChange);
  _focusNode.addListener(_handleFocusChange);
}