updateStyle method

void updateStyle(
  1. TextStyle style
)

This is the core function of the rich_field_controller. I takes a required style and applies it to the selected text. If there is no active selection, but the focus is still on the TextFiled, then the style is applied to the word containing the cursor.

Implementation

void updateStyle(TextStyle style) {
  selection = _paragraph.selection ?? selection;
  _paragraph.updateSelectedTextStyle(style);
}