float.tryParse(str)

signature
float.tryParse(s: str) -> float | null

Try to parse a float from a string. If the string is not a valid float, `null` is returned.