How to create underlines for parts of text in textfield using offset , i can replace the mistake word with correct word but i can't change style of this is word to notify user that it's error.
I Can use the buildTextSpan Method but it's not working with me.


The idea is to use a custom
TextEditingControllerthat overrides thebuildTextSpanmethod. You can then return your ownTextSpanthat uses different styles for parts of the text.Here's just a minimal example of how you can achieve that. Be aware that there might be some other aspects from the original
buildTextSpanthat you need to implement in the overriding method as well.Define the controller with the custom controller class in the state of your
StatefulWidget:You can access the
rangesproperty: