looseValue<T> function
T?
looseValue<T>(
- T? value
Implementation
T? looseValue<T>(T? value) {
if (value is String) {
final tmpString = value.trim();
if (tmpString.isEmpty) {
return null;
}
} else if (value is List && value.isEmpty) {
return null;
} else if (value is Map && value.isEmpty) {
return null;
}
return value;
}