Last active
December 15, 2020 17:41
-
-
Save jairoFernandez/2b7b5b05daa7052cb5e1bec54bc4ba26 to your computer and use it in GitHub Desktop.
Creator Functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
createProducts(int quantity) { | |
final data = []; | |
for (var i = 0; i < quantity; i++) { | |
data.add({"id": i, "name": "name $i", "user": rng.nextInt(quantity - 1)}); | |
} | |
return data; | |
} | |
createUsers(int quantity) { | |
final data = []; | |
for (var i = 0; i < quantity; i++) { | |
data.add({"id": i, "user": "User $i"}); | |
} | |
return data; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of user | |
[ | |
{ | |
"id": 1, | |
"user": "User 1" | |
}, | |
{ | |
"id": 20, | |
"user": "User 20" | |
} | |
] | |
# Example of Product | |
[ | |
{ | |
"id": 1, | |
"name": "name 1", | |
"user": 20 | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment