textDirectionToAxisDirection function

AxisDirection textDirectionToAxisDirection(
  1. TextDirection textDirection
)

Returns the AxisDirection in which reading occurs in the given TextDirection.

Specifically, returns AxisDirection.left for TextDirection.rtl and AxisDirection.right for TextDirection.ltr.

Implementation

AxisDirection textDirectionToAxisDirection(TextDirection textDirection) {
  switch (textDirection) {
    case TextDirection.rtl:
      return AxisDirection.left;
    case TextDirection.ltr:
      return AxisDirection.right;
  }
}