they are both. The are predators of the small shrimp and other crustaceans that live in the water. At the same time, they in turn are prey for larger predators like large storks, vultures and birds of prey, as well as snakes, lions, tigers and wild dogs.
Like Andrew says, they can be both. There are lots of things in the water where they live that they like to eat. But they don’t have teeth, so they’re not really very scary predators. Mostly they do filter feeding, and eat things like algae and shrimp. In some parts of the world, flamingos eat fish!
And of course there are things that like to eat them, like Andrew says. And a long time ago…there were PEOPLE that ate flamingos!!!