Skip to content
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

Closed
wants to merge 1 commit into from
Closed

seed for random generator #29

wants to merge 1 commit into from

Conversation

fflori4n
Copy link

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

  • double check the original issue to confirm it is fully satisfied
  • add testing notes and screenshots in PR description to help guide reviewers

Added method for setting seed of random generator
Comment on lines -155 to -175

/// 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();
Copy link
Owner

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?

Copy link
Author

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

Copy link
Owner

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(),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove image?

@daemon3000 daemon3000 mentioned this pull request Dec 13, 2020
2 tasks
@drager
Copy link
Owner

drager commented Jan 10, 2021

Closing this due to #32

@drager drager closed this Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants