Closed RicardoMudinyane closed 2 months ago
Hi @RicardoMudinyane, how are you doing?
I've run this code:
import 'package:faker/faker.dart';
void main() {
final List<User> users = [];
for (int i = 0; i < 10; i++) {
var faker = Faker();
users.add(User(
name: faker.person.firstName(),
lastName: faker.person.lastName(),
));
}
for (var user in users) {
print('${user.name} ${user.lastName}');
}
}
class User {
String name;
String lastName;
User({required this.name, required this.lastName});
}
And got this output:
Are you still facing the error?
I am trying to create multiple users with lastName, firstName, email and so on... I have a for loop and call faker each time, but it's creating the same user multiple times. I expected it to create multiple users with different names and so on...
Code snippet