positionModal method

  1. @override
Offset positionModal(
  1. Size availableSize,
  2. Size modalContentSize,
  3. TextDirection textDirection
)
override

Calculates the position of the modal within the screen based on text direction. This ensures correct alignment with the screen's edge appropriate for the text direction.

Implementation

@override
Offset positionModal(
  Size availableSize,
  Size modalContentSize,
  TextDirection textDirection,
) {
  final xOffset = textDirection == TextDirection.rtl
      ? 0.0
      : max(0.0, availableSize.width - modalContentSize.width);
  return Offset(xOffset, 0);
}