Skip to content

Commit

Permalink
remove depricated imageProviders
Browse files Browse the repository at this point in the history
  • Loading branch information
casvanluijtelaar committed Jul 10, 2023
1 parent 63c19b9 commit 5465ef6
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 436 deletions.
2 changes: 0 additions & 2 deletions analysis_options.yaml
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/**
9 changes: 5 additions & 4 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ packages:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.17.2"
faker_dart:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.1.9"
version: "0.1.11"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.18.0 <4.0.0"
2 changes: 1 addition & 1 deletion lib/src/faker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Faker {
/// {@template image}
/// generate random valid image urls from different sources
/// {@endtemplate}
Image get image => Image(instance);
Image get image => Image();

/// {@template name}
/// generate random names & jobs
Expand Down
24 changes: 0 additions & 24 deletions lib/src/image.dart
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);
}
}
95 changes: 0 additions & 95 deletions lib/src/image_providers/lorempixel.dart

This file was deleted.

72 changes: 0 additions & 72 deletions lib/src/image_providers/unsplash.dart

This file was deleted.

Loading

0 comments on commit 5465ef6

Please sign in to comment.