

Perhaps they assumed that you felt obligated to speak to them, and they felt the need to absolve you of that obligation. That would be the literal meaning of the phrase.
A different interpretation could be that they didn’t want to continue the conversation. In this scenario, they would prefer to be silent, and by suggesting that, “You don’t have to do this,” they have given you a polite, symbolic agency in ending the conversation, implying that both of you would rather be silent. In this way, instead of directly rejecting you, the decision to be silent would be shared. It’s a way of allowing you to save face.
Note that just because they might want to be silent, doesn’t mean that they dislike you. There are many reasons why people might know to speak at any given moment, and some people are just shy.
It’s hard to say which interpretation is correct without hearing the tone of voice, and understanding the general situation. There could be other factors or other interpretations as well.
Flirting is a pretty nebulous term.
My personal definition of flirting is any positive expression or behavior which:
examples:
A typically reserved guy pulling you aside and animatedly asking about your interest.
A woman who normally doesn’t touch you is repeatedly teasing you about your shirt, pulling on the fabric.
A good friend begins to repeatedly and unexpectedly invite you over for one on one movie nights despite obvious inconveniences.
That’s just my opinion, though. I believe most people are looking for these heightened expressions of flirting to confirm interest.