How much does it cost to hire an immigration lawyer?

I know immigration cases can get complicated, and I know hiring a lawyer can make a huge difference, but how much does it actually cost? Do most lawyers charge flat fees, or is it all hourly? If you’ve worked with an immigration lawyer before, what did you pay, and do you think it was worth it?