The problem with detecting flirting is its so vague.
There is no universal definition of what flirting is.
Some people presume its just about being nice towards someone, or a smile.
Others treat it as a more complex manner, body language, semantics (word choice), tone of voice, etc.
Its kind of an all of the above because each individual chooses to (or not) send these signals in different ways.
Its really a game of guess work and intuition. Sometimes your wrong, sometimes your right.
The best way to approach someone who you think might be flirting with you or someone your interested in is to treat them like an individual, hello my name is Insert name here.
Then start a conversation etc.
Shows confidence and respect.
No lame cheesy pick up lines, no sleezy terms of endearment used on complete stranger etc.
Seems plain but it works, or has worked for me.
Contact me if you ever need anyone to talk or advice about anything. I will offer you only what I believe is the truth and my advice.
I can passionately disagree with you on an issue and still be your friend, lover, counselor, shoulder to lean on, or maintain a number of other forms of relationships, I only hope I am not being too conceited when I ask you to do the same.
This is why I am here