If your avoidant ex’s behaviours have been consistently distant they’re likely a dismissive avoidant, but if their behaviours are generally confusing and contradicting, they’re likely a fearful avoidant.
Set boundaries that make contact safe and respectful for you and for your dismissive avoidant ex at the same time. E.g. “I’m okay with a text every couple of days, but I’m not okay with a week with no contact.”
This is how you’d want someone you love to reassure you, but when dealing with a fearful avoidant ex, it can backfire. They feel overwhelmed and distances, and you end up feeling rejected and abandoned.