toggleBold method

void toggleBold()
inherited

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(),
  );
}