Sadly, cab drivers did the same thing. Countless times I was given overpriced rates in times of need, like late night closing time.
Are you sure you actually rode a taxi and not some illegal or almost illegal rideshare like Uber which has no such regulations? If I were you I would have taken a picture of the car with the license plate and then reported them to the authorities.
Up front pricing is way better. When I used to do cabs I'd always do upfront prices. $40 to the airport no meter includes tip. 50 ok sounds good. Let's go.