BEST faker package available for dart that generates fake data you need.
faker_x was not created just to be a typical faker library but a library that is easy to contribute and grow.
With faker libraries there are many localizations that need to be supported while each of them share many resources which fake values can be generated from, almost all of them will have different resources that only make sense for that localization. Being easy to change, contribute & maintain was one of the top metrics of development when I started creating this package. In order to give dart language a faker library it deserves while also valuing dart developers time, faker_x uses code generation to generate its library code, tests & documents so if you wish to add new resources or fake value generators, you only need to focus on putting in the data instead of reading the source code and trying to figure it out (which you are free to do so if you wish). Please read the contribution guide to read the step by step guide on how to change or add new values and resources to faker_x.
Here are some of the values faker_x can generate. for complete details checkout Localizations.
final phoneNumber = FakerX.localized.en_us.phone.phoneNumber;
final address = FakerX.localized.en_us.address.address;
final jobTitle = FakerX.localized.en_us.job.jobTitle;
final fullName = FakerX.localized.en_us.person.fullName;
final colorHex = FakerX.localized.en_us.color.colorHex;
final sentence = FakerX.localized.en_us.lorem.sentence;
final car = FakerX.localized.en_us.vehicle.car;
final email = FakerX.localized.en_us.internet.email;
final ipv4 = FakerX.localized.en_us.internet.ipv4;
final emoji = FakerX.localized.en_us.internet.emoji;
final avatarUri = FakerX.localized.en_us.image.avatarUri;
final geoLocation = FakerX.localized.en_us.location.geoLocation;
final emailFrom = FakerX.localized.en_us.internet.emailFrom(
firstName: 'alireza',
lastName: 'easazade',
provider: 'gmail.com',
);
final image = FakerX.localized.en_us.image.image(
width: 300,
height: 400,
keywords: ['pet', 'dog'],
);
Please Read the Contribution Guide. It is written in detail to avoid any confusions and help you understand what you need to do to make your contributions. If there is any confusion or question you can open an issue or ask your question on your open pull request.
Below you can see a table of all the locales and all the resources and values that are available for them. Right now faker_x supports only 2 locales which you can see in table below. more will be added soon
- Fake value generators marked in [black] are available for all locales and generate the value differently according to that locale.
- Fake value generators marked in [green]🟢 are globally shared between different locales and generate values using same methods for all locales.
- Fake value generator marked in [blue]🔵 are the ones that are only available for that locale
en_us | address(14) | address | building number | city name | city prefix 🔵 | city suffix 🔵 | neighborhood 🔵 | postcode | postcode format 🔵 | secondary address 🔵 | state | state abbr 🔵 | street address 🔵 | street name | street suffix 🔵 |
---|---|---|
animal(1) | animal name | |
vehicle(1) | car | |
color(2) | color hex 🟢 | color name | |
person(7) | first name en 🟢 | last name en 🟢 | first name | first name female | first name male | full name | last name | |
phone(2) | international phone number | phone number | |
job(3) | job prefix 🔵 | job suffix 🔵 | job title | |
automotive(1) | license plate | |
lorem(3) | paragraph 🟢 | sentence | word | |
image(2) | avatar uri 🟢 | image 🟢 | |
internet(18) | disposable email 🟢 | disposable mail provider 🟢 | domain name 🟢 | domain suffixes 🟢 | email 🟢 | email from 🟢 | emoji 🟢 | http url 🟢 | https url 🟢 | ipv4 🟢 | ipv6 🟢 | mac address 🟢 | mail provider 🟢 | password 🟢 | safe email 🟢 | uri 🟢 | user name 🟢 | user name from 🟢 | |
location(1) | geo location 🟢 | |
fa_ir | address(10) | address | alley 🔵 | building name 🔵 | building number | city name | postcode | state | street name | street prefix 🔵 | street suffix 🔵 |
animal(1) | animal name | |
vehicle(1) | car | |
color(2) | color hex 🟢 | color name | |
person(7) | first name en 🟢 | last name en 🟢 | first name | first name female | first name male | full name | last name | |
phone(2) | international phone number | phone number | |
job(1) | job title | |
automotive(1) | license plate | |
lorem(3) | paragraph 🟢 | sentence | word | |
image(2) | avatar uri 🟢 | image 🟢 | |
internet(18) | disposable email 🟢 | disposable mail provider 🟢 | domain name 🟢 | domain suffixes 🟢 | email 🟢 | email from 🟢 | emoji 🟢 | http url 🟢 | https url 🟢 | ipv4 🟢 | ipv6 🟢 | mac address 🟢 | mail provider 🟢 | password 🟢 | safe email 🟢 | uri 🟢 | user name 🟢 | user name from 🟢 | |
location(1) | geo location 🟢 |