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:
Théo Poizat
2025-12-11 11:13:35 +01:00
committed by Dat H. Pham
parent 2228596c1c
commit d369fcbf5f
4 changed files with 35 additions and 25 deletions
@@ -561,9 +561,11 @@ class ComposerView extends GetWidget<ComposerController> {
}
return Obx(() {
if (controller.hasTextSelection.value &&
controller.textSelectionCoordinates.value != null) {
final coordinates = controller.textSelectionCoordinates.value!;
final textSelection = controller.editorTextSelection.value;
if (textSelection != null &&
textSelection.hasSelection &&
textSelection.coordinates != null) {
final coordinates = textSelection.coordinates!;
// Account for the horizontal padding around the editor
const editorHorizontalPadding = 12.0;
return PositionedDirectional(