toCrossAxisAlignment method

CrossAxisAlignment toCrossAxisAlignment({
  1. CrossAxisAlignment? defaultCrossAxisAlignment,
})

Implementation

CrossAxisAlignment toCrossAxisAlignment({
  CrossAxisAlignment? defaultCrossAxisAlignment,
}) {
  if ([Alignment.centerLeft, Alignment.bottomLeft, Alignment.topLeft]
      .contains(this)) {
    return CrossAxisAlignment.start;
  }
  if ([Alignment.centerRight, Alignment.topRight, Alignment.bottomRight]
      .contains(this)) {
    return CrossAxisAlignment.end;
  }
  return defaultCrossAxisAlignment ?? CrossAxisAlignment.center;
}