-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63c19b9
commit 5465ef6
Showing
10 changed files
with
157 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
include: package:very_good_analysis/analysis_options.yaml | ||
|
||
analyzer: | ||
exclude: | ||
- lib/src/locales/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,14 @@ | ||
import 'package:faker_dart/faker_dart.dart'; | ||
import 'package:faker_dart/src/image_providers/lorempicsum.dart'; | ||
import 'package:faker_dart/src/image_providers/lorempixel.dart' | ||
hide LoremPixelCategory; | ||
import 'package:faker_dart/src/image_providers/unsplash.dart' | ||
hide UnsplashCategory; | ||
|
||
/// {@macro image} | ||
class Image { | ||
/// {@macro image} | ||
Image(this._faker); | ||
|
||
final Faker _faker; | ||
|
||
/// {@template loremPicsum} | ||
/// generate rondom image urls from loremPicsum | ||
/// {@endtemplate} | ||
final LoremPicsum loremPicsum = LoremPicsum(); | ||
|
||
/// {@template loremPixel} | ||
/// generate rondom image urls from loremPixel | ||
/// {@endtemplate} | ||
final LoremPixel loremPixel = LoremPixel(); | ||
|
||
/// {@template unsplash} | ||
/// generate rondom image urls from unsplash | ||
/// {@endtemplate} | ||
final Unsplash unsplash = Unsplash(); | ||
|
||
/// returns a random image from a random image provider | ||
String image({int? width, int? height}) { | ||
final chance = _faker.datatype.number(max: 2); | ||
|
||
if (chance == 0) return unsplash.image(w: width, h: height); | ||
if (chance == 1) return loremPixel.image(width: width, height: height); | ||
return loremPicsum.image(width: width, height: height); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.