done method
Handles the "Done" action, either by applying changes or closing the editor.
Implementation
void done(TextStyle fontStyle) {
if (_textCtrl.text.trim().isNotEmpty) {
Navigator.of(context).pop(
TextLayerData(
text: _textCtrl.text.trim(),
background: _getBackgroundColor,
color: _getTextColor,
fontStyle: fontStyle,
align: align,
colorMode: backgroundColorMode,
colorPickerPosition: _colorPosition,
),
);
} else {
Navigator.of(context).pop();
}
}