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: _backgroundColor,
color: _textColor,
align: align,
fontScale: _fontScale,
colorMode: backgroundColorMode,
colorPickerPosition: colorPosition,
textStyle: selectedTextStyle,
customSecondaryColor: _secondaryColor != null,
),
);
} else {
Navigator.of(context).pop();
}
textEditorCallbacks?.handleDone();
}