faker 1.3.0 copy "faker: ^1.3.0" to clipboard
faker: ^1.3.0 copied to clipboard

outdated

A library for generating fake data. faker is heavily inspired by the Python package faker and, the Ruby package ffaker.

example/faker.dart

library faker.example;

import 'package:faker/faker.dart';

void main() {
  // Generate some different types of data.
  print(faker.address.country());
  print(faker.company.name());
  print(faker.currency.code());
  print(faker.internet.ipv4Address());
  print(faker.job.title());
  print(faker.person.firstName());
  print(faker.sport.name());

  // Generate a random amount of IP v4 addresses (max 10).
  print(random.amount((_) => faker.internet.ipv4Address(), 10));

  // Generate random boolean.
  print(random.boolean());

  // Generate random decimal.
  print(random.decimal());

  // Generate random DateTime, between the years 2000 and 2020
  print(faker.date.dateTime(minYear: 2000, maxYear: 2020));

  // Generate random User Agent, with osName iOS
  print(faker.internet.userAgent(osName: 'iOS'));
}
818
likes
40
pub points
98%
popularity

Publisher

unverified uploader

A library for generating fake data. faker is heavily inspired by the Python package faker and, the Ruby package ffaker.

Repository (GitHub)
View/report issues

License

MIT (license)

More

Packages that depend on faker