I would say both the HTC U11 and the OnePlus 5 would be great two-year commitments. It depends on what you're looking for. They have similar features (double tap to wake screen, similar battery life, front fingerprint scanner); but there are hardware differences as well. I think they both have the latest software installed too! It could even come down to pricing - the OnePlus is ~$200 less than the U11.
Sorry that I'm not that helpful here lool, it's hard to choose between them! I think if you're just going to slap down flagships, though, and compare them that way, the U11, in my opinion, is the best flagship out there at the moment.