-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
faker.dart
79 lines (71 loc) · 2.2 KB
/
faker.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import 'package:faker/src/date.dart';
import 'package:faker/src/lorem.dart';
import 'package:faker/src/phone_number.dart';
import 'package:faker/src/providers/default_providers.dart';
import 'package:faker/src/providers/fa_providers.dart';
import 'address.dart';
import 'company.dart';
import 'colors.dart';
import 'conference.dart';
import 'currency.dart';
import 'food.dart';
import 'guid.dart';
import 'image.dart';
import 'internet.dart';
import 'job.dart';
import 'jwt.dart';
import 'person.dart';
import 'providers/base_providers.dart';
import 'random_generator.dart';
import 'sport.dart';
import 'vehicle.dart';
final Faker faker = Faker.withGenerator(random);
class Faker {
final Address address;
final Conference conference;
final Color color;
final Company company;
final Currency currency;
final Food food;
final Guid guid;
final Image image;
final Internet internet;
final Job job;
final Jwt jwt;
final Lorem lorem;
final Person person;
final PhoneNumber phoneNumber;
final Sport sport;
final Vehicle vehicle;
final Date date;
final RandomGenerator randomGenerator;
Faker.withGenerator(RandomGenerator random, {FakerDataProvider? provider})
: address = Address(Person(random)),
conference = Conference(random),
color = Color(random),
company = Company(Person(random)),
currency = Currency(random),
food = Food(random),
guid = Guid(random),
image = Image(),
internet = Internet(random),
job = Job(random),
jwt = Jwt(),
lorem = Lorem(
random, provider?.loremDataProvider ?? DefaultLoremDataProvider()),
person = Person(random),
sport = Sport(random),
date = Date(random),
phoneNumber = PhoneNumber(random),
vehicle = Vehicle(),
randomGenerator = random;
factory Faker({int? seed, FakerDataProvider? provider}) =>
Faker.withGenerator(RandomGenerator(seed: seed), provider: provider);
}
class FakerDataProvider {
final LoremDataProvider? loremDataProvider;
FakerDataProvider({this.loremDataProvider});
}
class FakerDataProviderFa extends FakerDataProvider {
FakerDataProviderFa() : super(loremDataProvider: LoremDataProviderFa());
}