openTextEditor method

void openTextEditor({
  1. Duration duration = const Duration(milliseconds: 50),
})

Opens the text editor.

This method opens the text editor, allowing the user to add or edit text layers on the image.

Implementation

void openTextEditor({
  Duration duration = const Duration(milliseconds: 50),
}) async {
  TextLayerData? layer = await openPage(
    TextEditor(
      key: textEditor,
      configs: configs,
      theme: _theme,
      callbacks: callbacks,
    ),
    duration: duration,
  );

  if (layer == null || !mounted) return;

  addLayer(layer, blockSelectLayer: true);
  _selectLayerAfterHeroIsDone(layer.id);

  setState(() {});
  mainEditorCallbacks?.handleUpdateUI();
}