Simplify observed values about text selection in composer
hasTextSelection had no interest. The other two values have been put inside an object to observe only one object.
This commit is contained in:
@@ -69,6 +69,18 @@ class TextSelectionCoordinates {
|
||||
Offset get position => Offset(x, y);
|
||||
}
|
||||
|
||||
class EditorTextSelection {
|
||||
final String? selectedText;
|
||||
final Offset? coordinates;
|
||||
|
||||
const EditorTextSelection({
|
||||
this.selectedText,
|
||||
this.coordinates,
|
||||
});
|
||||
|
||||
bool get hasSelection => selectedText != null && selectedText!.isNotEmpty;
|
||||
}
|
||||
|
||||
mixin TextSelectionMixin<T extends StatefulWidget> on State<T> {
|
||||
OnTextSelectionChanged? get onSelectionChanged => null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user