|
|
|
@ -20,6 +20,7 @@ class QuillController extends ChangeNotifier { |
|
|
|
|
bool keepStyleOnNewLine = false, |
|
|
|
|
this.onReplaceText, |
|
|
|
|
this.onDelete, |
|
|
|
|
this.onSelectionCompleted, |
|
|
|
|
}) : _selection = selection, |
|
|
|
|
_keepStyleOnNewLine = keepStyleOnNewLine; |
|
|
|
|
|
|
|
|
@ -48,6 +49,8 @@ class QuillController extends ChangeNotifier { |
|
|
|
|
/// Custom delete handler |
|
|
|
|
DeleteCallback? onDelete; |
|
|
|
|
|
|
|
|
|
void Function()? onSelectionCompleted; |
|
|
|
|
|
|
|
|
|
/// Store any styles attribute that got toggled by the tap of a button |
|
|
|
|
/// and that has not been applied yet. |
|
|
|
|
/// It gets reset after each format action within the [document]. |
|
|
|
@ -242,10 +245,6 @@ class QuillController extends ChangeNotifier { |
|
|
|
|
notifyListeners(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// callback sub classes can override to implement actions when a selection is |
|
|
|
|
// completed. |
|
|
|
|
void selectionCompleted() {} |
|
|
|
|
|
|
|
|
|
void compose(Delta delta, TextSelection textSelection, ChangeSource source) { |
|
|
|
|
if (delta.isNotEmpty) { |
|
|
|
|
document.compose(delta, source); |
|
|
|
|