getCursorRect method
Get the cursor rect at the current selection/cursor position.
Requires passing the TextEditingController to get the current selection. Returns null if no selection or tracker not attached.
Implementation
Rect? getCursorRect(TextEditingController controller) {
if (!controller.selection.isValid) return null;
return getCursorRectAt(controller.selection.baseOffset);
}