I will note that one could design a pretty printer that reliably had better performance if the formatting style they chose was simpler and more amenable to it.
My (mostly self-imposed) task was more difficult because I was trying to follow the existing style that humans were hand-applying to their Dart code, and that had a lot of tricky non-local cases that look nice but are hard to automate.