livrToString function
Converts a primitive value to a string like JavaScript does, so values
are compared the same way in all implementations: 10.0 becomes '10'
(not '10.0'), -0.0 becomes '0'.
Implementation
String livrToString(Object? value) {
if (value is String) return value;
if (value is double) return _doubleToString(value);
return value.toString();
}