Refine IME composing range styling by applying underline as text style #2244
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.
Description
Changed the implementation of the underline styling during IME conversion. Instead of manually drawing a line beneath the composing text, the underline is now applied directly as a text style to the conversion range. This simplifies the implementation and brings it in line with Flutter's standard
TextEditingController
behavior.TextEditingController#buildTextSpan
https://github.com/flutter/flutter/blob/2277e055508ee6e11ea1313a06ec5b353e76eecc/packages/flutter/lib/src/widgets/editable_text.dart#L285-L309
In the previous implementation, there was an issue where the composing style appeared like a strikethrough, positioned around the middle of the text, especially when the text height was higher than usual, such as with headers. This issue has been completely resolved with the current fix.
before:

after:

Related Issues
Improve No underline displayed for characters being converted with IME on iOS #2179
✨ New feature: Adds new functionality without breaking existing features.
🛠️ Bug fix: Resolves an issue without altering current behavior.
🧹 Code refactor: Code restructuring that does not affect behavior.
❌ Breaking change: Alters existing functionality and requires updates.
🧪 Tests: Adds new tests or modifies existing tests.
📝 Documentation: Updates or additions to documentation.
🗑️ Chore: Routine tasks, or maintenance.
✅ Build configuration change: Changes to build or deploy processes.
Suggestions