Feeling like a bad mom.

Rachel • Young mother to two beautiful little girls. 💕
I'm 25 weeks pregnant with a two-year-old little girl whose usually a very well behaved child, but lately she has been awful. She screams and throws fits in public, she's being violent towards me and my husband, including jumping on my stomach which makes it hurt, she's refusing to listen if we try to tell her anything and just screams at us, and she's refusing to go to bed, even though we've had a bedtime schedule since she was one, so it's nothing new. 
I'm so exhausted and sick, and she just keeps frustrating me. I told myself I'd never spank her, but I've found myself spanking her a couple of times already, and I hate that. 
I feel like she hates me because she will cling to anyone else that comes to see us like my in-laws or her aunt. I feel like it makes me look bad, and it also just makes me feel horrible inside, like she doesn't love me. I know it's not true, but I just want to cry because I want her to run to me instead of someone else. 
I know she's just a toddler and she's going through that stage, but what can I do? I'm going insane, and I'm so close to a breakdown. It's not healthy for my pregnancy now, and I'm just afraid that I'm going to hurt myself or my baby is going to be affected by all of this stress.
I've tried talking to her and being calm, getting on her level, offering compromises, and all of that, but I'm at my breaking point. 
What do I do?