toStringValue function
Converts data
to String
or throws FormatException if cannot convert.
Implementation
String toStringValue(Object? data) {
if (data == null) throw const NullValueException();
if (data is String) return data;
return data.toString();
}