positionModal method
Offset
positionModal(
- Size availableSize,
- Size modalContentSize,
- 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);
}