My dream device is a way to quickly make tea. I can use most of the parts from a Mr. Coffee tea maker but the last part is a way to start the flow of water, measure say, 1/2 a gallon and then stop the flow. It can't be hard . . . ice makers do it all the time. How does an ice maker do it?
You might consider an ultrasonic flow meter.
But, I'd either use a calibrated timer or prefill a chamber of known volume on demand (using a sensor to show when it's full), then empty the chamber into the cup.
Put the vessel that is receiving the hot water on a sprung base, and attach a microswitch to the base that is pressed down as the vessel fills with water that cuts the power to the pump (or heater if your using steam pressure to transfer the water) when the base is pushed down far enough.
You'll have to fiddle around with the sprung base and switch to get it to trip at the moment that it has been filled to the desired level.
Cheap appliances typically use a water regulator and a timer. Some water inlet valves include the pressure regulator, so you can buy one part and get both the regulator to give you a consistent flow, and a solenoid to turn the flow on and off.
You could try one similar to this.
Most appliances use timers or level switches as mentioned before. To answer your specific question, you can use one of these.
I haven't tried one yet, but the price is so low (flow sensors tend to be expensive!!) I can't resist.
Proteus Industries makes electronic flow meters. They came to mind because I once helped swap one out in a high powered laser exciter; one was used to detect if the flow of water cooling the system was inadequate, and would shut down power.