AxisDirection textDirectionToAxisDirection(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.

Source

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