OP, to reassure you (as a lot of posters have been a bit mean!), if a dog is likely to attack it generally won't bark, it'll 'stiffen' its body, perhaps raise its hackles (hairs on the spine, near the neck), stop, stare very hard without blinking, and perhaps lower its body slightly. It will give you a lot of body language signals, but generally barking isn't one of them.
It sounds like this dog was a bit freaked out by your child, and so barked to indicate this. It's a dog equivalent of saying, 'hey! I don't know what you're doing but I don't like it and pack it in!' Children, tantrums, loud noises, unexpected movements: all these can be frightening for dogs (which I know sounds daft when you don't have a dog or know dogs, but a lot of the time the human world freaks them out!).
The secondary bout of barking at you was likely a continuation of the first. A kind of 'hey! I see you and your noisy ways! Stay over there!' The fact that it held off from coming close shows that it was all noise; it had no intention of getting into a fight with you.
That said: had that been my dog, I'd have called her to me, reassured her (to stop her barking /show her there was nothing to be scared about) and understood that although she was freaked out, she was also likely to be freaking you out. Parents quite rightly worry about dogs and young kids: a good dog owner would have spotted this and intervened.