Something to explore in therapy to learn more about it.
Many women want to have a child so they will always have someone who loves them. It doesn't work that way, but that's the fantasy.
Longing for motherhood especially when you and your bf break up sounds like there is a lot about wanting to love and be loved, and not wanting to be alone, issues to resolve before taking on motherhood in order to be the mother that the child needs.
Love is wonderful and it comes in many forms