# toTextAlign method Null safety

TextAlign toTextAlign(

1. SimpleTextAlign? textAlign

)

## Implementation

    TextAlign toTextAlign(SimpleTextAlign? textAlign) {
      switch (textAlign) {
        case SimpleTextAlign.left:
          return TextAlign.left;
        case SimpleTextAlign.center:
          return TextAlign.center;
        case SimpleTextAlign.right:
          return TextAlign.right;
        case SimpleTextAlign.end:
          return TextAlign.end;
        case SimpleTextAlign.justify:
          return TextAlign.justify;
        case SimpleTextAlign.start:
          return TextAlign.start;
        case SimpleTextAlign.unknown:
          return TextAlign.left;
        case null:
          break;
      }
      return TextAlign.left;
    }