Skip to content

Instantly share code, notes, and snippets.

@jairoFernandez
Created December 15, 2020 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jairoFernandez/12c250149ae21d65ac41bcf0f2750f32 to your computer and use it in GitHub Desktop.
Save jairoFernandez/12c250149ae21d65ac41bcf0f2750f32 to your computer and use it in GitHub Desktop.
badCombinatorFunction(List<dynamic> products, List<dynamic> users) {
final data = [];
for (var i = 0; i < products.length; i++) {
final user = users.firstWhere((u) => u['id'] == products[i]['user']);
data.add({
"id": products[i]['id'],
"name": products[i]['name'],
"user": user,
});
}
return data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment