done method

void done()

Handles the "Done" action, either by applying changes or closing the editor.

Implementation

void done() {
  if (_textCtrl.text.trim().isNotEmpty) {
    Navigator.of(context).pop(
      TextLayerData(
        text: _textCtrl.text.trim(),
        background: _getBackgroundColor,
        color: _getTextColor,
        align: align,
        fontScale: fontScale,
        colorMode: backgroundColorMode,
        colorPickerPosition: _colorPosition,
        textStyle: selectedTextStyle,
        // fontFamily: 'Roboto',
      ),
    );
  } else {
    Navigator.of(context).pop();
  }
  textEditorCallbacks?.handleDone();
}