pixabay 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 43

Unofficial Pixabay REST API for Dart

Usage #

A simple usage example:

import 'package:pixabay/pixabay.dart';

main() async{
  var client = new PixabayClient(APIKey.value);
  
    var searchResult = await client.searchPhoto("aurora",
        language: SupportedLanguages.en, imgType: ImageTypes.photo);
  
    for (var p in searchResult.photos) {
      print(p.imageUrl);
    }
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.1.0 #

  • Initial version

example/pixabay_example.dart

import 'package:pixabay/pixabay.dart';

import '../secure/api_key.dart';

main() async {
  var client = PixabayClient(APIKey.value);

  var search = await client.searchPhoto("aurora",
      language: SupportedLanguages.en, imgType: ImageTypes.photo);

  for (var p in search.photos) {
    print(p.imageUrl);
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  pixabay: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:pixabay/pixabay.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
92
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
79
Overall:
Weighted score of the above. [more]
43
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.9+1

Analysis suggestions

Package not compatible with runtime flutter-web of web

Because of the import of dart:io via the import chain package:pixabay/pixabay.dart->package:pixabay/src/pixabay_client.dart->dart:io

Package not compatible with runtime web

Because of the import of dart:io via the import chain package:pixabay/pixabay.dart->package:pixabay/src/pixabay_client.dart->dart:io

Health suggestions

Fix lib/src/pixabay_endpoints.dart. (-1.99 points)

Analysis of lib/src/pixabay_endpoints.dart reported 4 hints:

line 36 col 27: Unnecessary new keyword.

line 94 col 27: Unnecessary new keyword.

line 145 col 27: Unnecessary new keyword.

line 196 col 27: Unnecessary new keyword.

Fix lib/src/pixabay_photo_search_result.dart. (-1.49 points)

Analysis of lib/src/pixabay_photo_search_result.dart reported 3 hints:

line 15 col 7: Unnecessary new keyword.

line 19 col 13: Unnecessary new keyword.

line 25 col 17: Unnecessary new keyword.

Fix lib/src/pixabay_video_search_result.dart. (-1.49 points)

Analysis of lib/src/pixabay_video_search_result.dart reported 3 hints:

line 15 col 7: Unnecessary new keyword.

line 19 col 13: Unnecessary new keyword.

line 25 col 17: Unnecessary new keyword.

Fix additional 6 files with analysis or formatting issues. (-3.50 points)

Additional issues in the following files:

  • lib/src/pixabay_client.dart (2 hints)
  • lib/src/pixabay_photo.dart (1 hint)
  • lib/src/pixabay_quota.dart (1 hint)
  • lib/src/pixabay_video.dart (1 hint)
  • lib/src/pixabay_video_size.dart (1 hint)
  • lib/src/pixabay_videos.dart (1 hint)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is getting outdated. (-1.10 points)

The package was last published 52 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
Dev dependencies
pedantic ^1.0.0
test ^1.0.0