Could you be friends with a girl you used to like?

I am asking this because I have a friend who used to like me 2 years ago, now we're friends and I am in a relationship. When we're together sometimes he sees flirty and I've noticed he started to avoid me a bit. Could you be friends with someone you liked?
Could you be friends with a girl you used to like?
Post Opinion