changeAlignment method
Changes the TextMetadata.alignment to the given alignment
.
note that you have to use RichTextField for changes made by this method to reflect.
or otherwise set the TextField.alignment
parameter of your textField to TextMetadata.alignment
while listening to changes in the controller.
example:
...
ValueListenableBuilder
Implementation
void changeAlignment(TextAlign alignment) {
applyDefaultMetadataChange(
(metadata ?? RichTextEditorController.defaultMetadata)
.copyWith(alignment: alignment),
);
}