A couple months I got flaked on (rather, I got stood-up), and I learned a good bit about the situation if it's very early on in the dating stage, like a first or second date. Here's what I refer to...
...the Two Strike Rule...if the girl flakes, let it go and give her another chance (unless she says she was out with her bf

). However, if she flakes or stands you up again, it's game over. Whatever her excuse is, just brush it off with a "it's cool" or "I'll see you around." Don't try to make further plans with her.
I'm not sure there's an exact science to guarantee 100% a girl won't flake on you, but try and establish some sort of connection that will keep her interested.