This site's content is perhaps a little blunt, but has the information that you require:
I'm not that blunt, so here is some info:
I have a lowrance HDS range plotter/sounder that does this (HDS 5m gen2)
it has a fuel flow sender model "EP-60r" which sends the fuel flow rate via NMEA2000 to the plotter or other NmEA2000 fuel flow gauge. You tell the plotter how big your tank is, and when you fill it up (either all the way or just how much you add) and it displays various fuel related thinks like a virtual level, consumption rate, range etc
Garmin do one called the GFS 10 sensor, which communicates via NMEA2000 or their CANnet interface. You would plug this into a suitable plotter/display unit.
Some modern engines have a flow sensor built in to the engine that can output flow rate onto a NMeA or proprietary data bus
There are also liquid level sensors that are fuel compatible. For example the lowrance EP-65r .These output a level value (full to empty) via NmeA2000 which will display a tank level gauge on your plotter that you can calibrate to a volume of fuel, but are not accurate enough to determine fuel flow rate
A level sensor in conjunction with a fuel flow rate sensor is an ideal combination; the flow sensor is perhaps 10% accurate, and if you just do a partial tank top up each time then these errors will compound to give you a false level reading if used on its own ( filling to the brim effectively re-calibrates the level).
Combine the level and flow sensor together and you will know if you have a leak or other loss from the system unaccounted for by the flow rate, and whether the flow meter errors are adding up, necessitating a full-top up .