Skip to content

Native Text processing context menu #2515

Open
@theachoem

Description

@theachoem

Have you checked for an existing issue?

Use case

Have access to native context menus like Translate, Search, etc.

Proposal


Changes in raw_editor_state.dart:
If we check in the Flutter text field, we can access those native context menus. What we need to do is load it in raw_editor_state.dart, then add them to the contextMenuButtonItems.

  @protected
  @override
  void initState() {
    super.initState();
    ....
    _initProcessTextActions();
  }

  /// Query the engine to initialize the list of text processing actions to show
  /// in the text selection toolbar.
  Future<void> _initProcessTextActions() async {
    _processTextActions.clear();
    _processTextActions.addAll(await _processTextService.queryTextActions());
  }

 List<ContextMenuButtonItem> get contextMenuButtonItems {
    return buttonItemsForToolbarOptions() ??
          EditableText.getEditableButtonItems(
            ...
          )
      ..addAll(_textProcessingActionButtonItems); <--- add them here.
  }

Reference

  • package:flutter/src/widgets/editable_text.dart:2946

I already added them to my app but it will be great to have them directly in Flutter Quill so I don't have to customize & will also benefit all Quill users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomersmoderateIssues that are important for improving functionality or user experience.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions