That's one of the traps with agreeing to be her friend. She's not attracted to you, she doesn't respect you. It's what girls tell boys when they are trying to let them down, "well we can still be friends." It's not what they really mean. She doesn't really want ot be friends, she interested in someone else. Agreeing to be friends is a attraction killer.
Yes, by all means be a man and repsectful in your interaction with the mother of your children. A woman won't be attracted to a man who hangs out with females and only gets talked to with no benefits. A friend to me is more than a acquaintance it's someone you want to spend time with and discuss things with. I couldn't imagine inviting the ex to a dinner party at my home. "oh and by the way bring a date." Nope, I couldn't do it.
M22,H45,W45 S21/18D12 Retain faith that you will prevail in the end, regardless of the difficulties and at the same time confront the most brutal facts of your current reality, whatever they might be.