Can taking different medications like vicodin or flexeril (cyclobenzaprine hcl) while pregnant cause the child to develop adhd?

Maybe. Adhd as such, probably not. But, these are dangerous drugs in pregnancy. The complications can be significant.
Vicodin pregnancy. If a person takes those meds without doctor's advise, early during pregnancy, that person also may have other behaviors that hurt the fetus. Difficult delivery can also raise risk of adhd-like behaviors. And the genetic make-up of the mother with dangerous behavior during pregnancy is the main culprit for the inheritance of adhd to the baby. Most all mental diagnositcs are inheritable.
Probably. The incidence of adhd increases with fetal exposure to nicotine, alcohol, cocaine, opioids, and marijuana. Avoid all these if you plan to get preganant.