Lots of good advice here already. I would just add that there is a difference between a “flexible” schedule and a “compatible” one. Academia is compatible in that winter and summer breaks align with the school calendar. It is possible to arrange your classes so you can pick the kids up after school (but you might experience push back for doing so). In many ways, it is not “flexible” in that it’s difficult to deviate from the prescribed calendar and that like any other working parent, you will have to accommodate for sick days and early dismissals. You may not be able to participate in field trips or take off from class to see a child do a school presentation.
While there is somewhat greater choice about where academics do their work, they still have to do that work and there can be a lot of it. Not all of it can be done at home. You would probably begin your work day before the kids get up in the morning and would continue to work after they go to bed. A true “vacation” can be elusive. Academic jobs are scarce - you may be offered employment in a location with a poor public school system or in an environment that isn’t optimal to raise a family. Then you might have to factor in the possibility of a lengthy commute and/or paying for private school.
I have a friend who is tenured at a flagship university and has a special needs child. She is thinking of leaving academia to teach high school instead because the administrative and research components of her job leave her stretched too thin and her child requires specific accommodations that aren’t available everywhere.
I think that HS teaching, assuming a manageable student load, is probably more compatible with parenting than academia. Other suggestions made here, like patent law, also sound sensible. Whatever you decide, I will pile on and say that the ability to be financially self-sufficient is essential - you never know what surprises life will bring. You sound like a sensible person and it is wise to think about work/family balance while you are still young and can chart your course. Good luck!