mobileEditor method

dynamic mobileEditor()

Implementation

Widget mobileEditor() {
  return MobileToolbarV2(
    toolbarItems: [
      textDecorationMobileToolbarItemV2,
      buildTextAndBackgroundColorMobileToolbarItem(
        textColorOptions: [],
      ),
      headingMobileToolbarItem,
      listMobileToolbarItem,
      linkMobileToolbarItem,
      quoteMobileToolbarItem,
    ],
    editorState: editorState,
    child: MobileFloatingToolbar(
      editorScrollController: editorScrollController,
      editorState: editorState,
      toolbarBuilder: (context, anchor, closeToolbar) {
        return AdaptiveTextSelectionToolbar.editable(
          clipboardStatus: ClipboardStatus.pasteable,
          onCopy: () {
            copyCommand.execute(editorState);
            closeToolbar();
          },
          onCut: () => cutCommand.execute(editorState),
          onPaste: () => pasteCommand.execute(editorState),
          onSelectAll: () => selectAllCommand.execute(editorState),
          onLiveTextInput: null,
          onLookUp: null,
          onSearchWeb: null,
          onShare: null,
          anchors: TextSelectionToolbarAnchors(
            primaryAnchor: anchor,
          ),
        );
      },
      child: AppFlowyEditor(
        // widget pass through
        editable: widget.editable,
        shrinkWrap: widget.shrinkWrap,
        autoFocus: widget.autoFocus,
        header: widget.header,
        // local states
        editorState: editorState,
        editorScrollController: editorScrollController,
        editorStyle: mobileEditorStyle(),
        footer: generateFooter(),
      ),
    ),
  );
}