Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adds Image faker #21

Merged
merged 5 commits into from
Oct 27, 2020
Merged

Adds Image faker #21

merged 5 commits into from
Oct 27, 2020

Conversation

igorgoncalves
Copy link
Contributor

Connection with issue(s)

Resolve issue #19

Testing and Review Notes

Generates a url to a image random image. The size of image is determined by width and height paramters. You can choose the image categories related by the keywords parameter separeted by comma .

Example:

   faker.image.image(width: 1200, height: 900, keywords: 'nature,people');

Result: https://source.unsplash.com/1200x900?nature,people

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

lib/src/image.dart Outdated Show resolved Hide resolved
@drager
Copy link
Owner

drager commented Mar 13, 2020

@igorgoncalves Thanks a lot! I had a thought that instead of passing a comma separated string for the keywords we could actually accept a List of strings e.g: faker.image.image(width: 1200, height: 900, keywords: ['nature', 'people']);. What do you think?

@igorgoncalves
Copy link
Contributor Author

Make sense to me, I will change that :D

@drager
Copy link
Owner

drager commented Mar 13, 2020

Great, thanks!

@igorgoncalves
Copy link
Contributor Author

The tests fails in Travis because this #22 I create a PR to resolve #23

new RegExp(r'^([A-Za-z0-9].+,[A-Za-z0-9]+)$|^([A-Za-z0-9]+)$');
if (keywordFormat.hasMatch(keywords)) {
url += '?' + keywords;
new RegExp(r'^([A-Za-z0-9].+,[A-Za-z0-9]+)$|^([A-Za-z0-9]+)$');
Copy link
Owner

Choose a reason for hiding this comment

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

Please run dart formatter on this file.

Copy link
Owner

@drager drager left a comment

Choose a reason for hiding this comment

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

Thanks a lot! It looks good!

@drager drager mentioned this pull request Apr 5, 2020
@drager drager merged commit 6aa3d62 into drager:master Oct 27, 2020
@drager drager mentioned this pull request Oct 27, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants