toggleUnderline method
void
toggleUnderline()
inherited
Toggles the TextMetadata.decoration between TextDecorationEnum.none and TextDecorationEnum.underline.
Implementation
void toggleUnderline() {
final TextMetadata tempMetadata =
metadata ?? RichTextEditorController.defaultMetadata;
final TextMetadata changedMetadata = tempMetadata.copyWith(
decoration: tempMetadata.decoration == TextDecorationEnum.underline
? TextDecorationEnum.none
: TextDecorationEnum.underline,
);
changeStyleOnSelectionChange(
changedMetadata: changedMetadata,
change: TextMetadataChange.fontDecoration,
modifiedDeltas: deltas.copy,
selection: selection,
);
}