1.
to think about or be interested in sth for a short time but not very seriously :
She flirted with the idea of becoming an actress when she was younger.
2.
to take risks or not worry about a dangerous situation that may happen :
to flirt with danger / death / disaster