-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
seed for random generator #29
Conversation
Added method for setting seed of random generator
|
||
/// Generates an User Agent from Predefined Dictionary | ||
/// with the given [osName] if provided. | ||
/// if not provided [osName] is an empty String or [''] | ||
/// | ||
/// Example: | ||
/// ```dart | ||
/// faker.internet.userAgent(); | ||
/// faker.internet.userAgent(osName:'ios'); | ||
/// ``` | ||
String userAgent({String osName = ''}) => random | ||
.element(UserAgents.fromJson(userAgentDatas) | ||
.userAgents | ||
.map((e) => e) | ||
.where( | ||
(element) => | ||
element.osName.toLowerCase().contains(osName.toLowerCase()), | ||
) | ||
.toList()) | ||
.userAgent | ||
.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these being deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. My bad. It seems that I used and older fork of faker, without the userAgent and image commit. Can you omit those changes, or should I make another pull request? Only added a method in random_generator.dart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make a new commit that brings those deletions back if possible.
@@ -39,7 +37,6 @@ class Faker { | |||
currency = const Currency(), | |||
food = const Food(), | |||
guid = const Guid(), | |||
image = const Image(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove image
?
Closing this due to #32 |
Added method for setting seed of random generator
Connection with issue(s)
Resolve issue #25
Testing and Review Notes
Only tested in Flutter for the web, but should work for all.
To Do