Description of change

With the BuildContext available, users can access
InheritedWidgets inside buildTextSpan
to retrieve state required to style the text,
or otherwise manipulate the created TextSpan.

Consider the example where we have a
HighlightTextEditingController that wants to
highlight text by setting its color to Theme.accentColor.

Before this change the controller implementation would look like this:

class

HighlightTextEditingController

extends

TextEditingController

HighlightTextEditingController

this

highlightColor

);

final

Color

highlightColor

@override

TextSpan

buildTextSpan

({

TextStyle

style

required

bool

withComposing

})