convertToParams function
Implementation
Map<String, String> convertToParams(Map<String, dynamic> objects) {
Map<String, String> params = new Map();
objects.forEach((key, value) {
if (value != null) {
if (value is String) {
params.putIfAbsent(key, () => value);
} else if (value is List || value is Map) {
params.putIfAbsent(key, () => jsonEncode(value));
} else
params.putIfAbsent(key, () => value.toString());
}
});
return params;
}