[SuperEditor] Expand usability of HintComponentBuilder. (Resolves #2655) #2824
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[SuperEditor] Expand usability of HintComponentBuilder. (Resolves #2655)
This PR modifies the
HintComponentBuilderto make it possible to use it in thedemo_text_with_hint.dartdemo.The
basicandattributednamed constructors were introduced. I used only two constructors with optional properties because, if we declare a separate constructor for each combination of parameters, there will be a lot of constructors.I had to modify the
HintComponentBuilderexisting constructor to remove theconstkeyword, so this is a breaking change. The fix is as simple as removing theconstkeyword at the constructor's calls.The demo was modified to use the
HintComponentBuilder. I used a bottom navigation bar to make it possible to use the demo on mobile.I simplified the existing logic to decide whether the hint should be displayed to
document.length == 1, because the node's index cannot be bigger than zero if there is a single node in the document, so that check was irrelevant.All places that were using the existing constructor were updated.
Screen.Recording.2025-11-10.at.15.40.57.mov