toggleBold method
void
toggleBold()
inherited
Toggles the TextMetadata.fontWeight between FontWeight.normal and FontWeight.w700.
Implementation
void toggleBold() {
final TextMetadata tempMetadata =
metadata ?? RichTextEditorController.defaultMetadata;
final TextMetadata changedMetadata = tempMetadata.copyWith(
fontWeight: tempMetadata.fontWeight == FontWeight.normal
? FontWeight.w700
: FontWeight.normal,
);
changeStyleOnSelectionChange(
changedMetadata: changedMetadata,
change: TextMetadataChange.fontWeight,
modifiedDeltas: deltas.copy,
selection: selection.copyWith(),
);
}