To indent and reformat code in Android Studio on Mac,
press Command +Option + L.
When formatting, if the number of characters per line is too short or too long,
Android Studio > Settings > Editor > Code Style > Dart > Line length
It can be adjusted by changing the value.