My house is built on piers with a 3' crawl space and the bottom of the floor joists are covered with osb and cellulose insulation blown in between the joists. So, If I ever had a flooded house, the repairs would be even worse because in addition to everything that you would have to do on a house built on a slab, I would also have to tear out and replace all of that joist insulation.
When designing the house, I pondered for quite a while on a solution to deal with such a catastrophe. I considered water alarms, pump control circuits (water is from a well with a submersible pump), and any other thing that I could think of.
I finally decided on a basic 'manual' strategy that has worked out well and is about as foolproof a solution as you can get.
At the water pressure tank in the utility room, I have a shutoff valve to shut off the water supply to all the house. I also have the pump (120VAC) plugged into its own dedicated wall outlet.
So, anytime I leave the house, I simply shut the valve and unplug the pump.
I even shut the valve at night before going to bed.
Wife thought this was ridiculous until our pastors house was flooded during the night because the toilet line failed. It happens. I had a washer hose fail in a previous house, but fortunately, I was home and shut off the water after just a couple of minutes.
If it has never happened to you, it's something you usually don't even consider until it's too late.
Another advantage of plugging in the pump is that I can completely isolate it from the electrical panel during the frequent thunderstorms we have in this area.