Skip to content

Commit

Permalink
[CHORE] replace hardcoded picsum urls with faker (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
krokyze authored Jan 12, 2025
1 parent 2eb74a6 commit 36eaeb0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions example/lib/post.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@ class Post {
Post(int id) : this._(id, Faker(seed: id));

Post._(this.id, Faker faker)
: imageSmall = 'https://picsum.photos/id/$id/128/128.webp',
imageLarge = 'https://picsum.photos/id/$id/512/512.webp',
: imageSmall = faker.image.loremPicsum(
width: 128,
height: 128,
seed: '$id',
imageFormat: ImageFormat.webp,
),
imageLarge = faker.image.loremPicsum(
width: 512,
height: 512,
seed: '$id',
imageFormat: ImageFormat.webp,
),
title = faker.food.dish(),
text = faker.lorem.sentences(10).join(' '),
author = faker.person.name(),
Expand Down

0 comments on commit 36eaeb0

Please sign in to comment.