removeAliasPrefix<T> function
Remove alias prefix (underscore) used in graphQL requests
Implementation
Map<String, T>? removeAliasPrefix<T>(Map<String, T?>? map) {
if (map == null) {
return null;
}
final mapResult = <String, T>{};
map.forEach((key, value) {
if (value != null) {
mapResult[key.replaceFirst('_', '')] = value;
}
});
return mapResult;
}