imgur 1.1.0

imgur.dart #

An Imgur API Client Library that uses Imgur's v3 API for Dart.

pub package workflow status

Usage #

A simple usage example to get your uploaded images:

import 'package:imgur/imgur.dart' as imgur;

main() async {
  final client = imgur.Imgur(imgur.Authentication.fromToken('YOUR_IMGUR_ACCESS_TOKEN'));

  /// Get your uploaded images
  final resp = await client.account.getImages();

  print(resp);
}

Upload an image:

import 'package:imgur/imgur.dart' as imgur;

main() async {
  final client = imgur.Imgur(imgur.Authentication.fromToken('YOUR_IMGUR_ACCESS_TOKEN'));

  /// Upload an image from path
  await client.image
      .uploadImage(
          imagePath: '/path/of/the/image.png',
          title: 'A title',
          description: 'A description')
      .then((image) => print('Uploaded image to: ${image.link}'));
}

Documentation #

A generated documentation is available at pub.dev.

Testing #

pub run test

Contributing #

You are interested in contributing please see the CONTRIBUTING.md file which will tell you more about:

  • Styling your contributions
  • Submitting issues and/or pull requests

Credits #

License #

This project is licensed under the MIT License - see the LICENSE file for details

1.1.0 #

  • BREAKING CHANGE: Services no longer return a BaseResponse or BaseResponseList instance but directly the content
  • Reformat code to follow dart standards
  • Rename deletehash field to deleteHash in GalleryImage, Image and Album classes.

1.0.21 #

  • Add uploadImage and uploadVideo methods to Image service
  • Add searchSuggestions to Gallery service
  • Add associate method to Account service
  • Add upload_image example

1.0.2 #

  • Change GalleryImage accountUrl field type from int to String
  • Add error handling for null input in baseModelListToJson method
  • Add some unit tests
  • Add getVotes and vote methods to image and album services
  • Add favoriteCount, tags and hasSound to Image and Album models
  • Add headers getter to Authentication class

1.0.1 #

  • Minor fixes based on pub.dev suggestions

1.0.0 #

  • Initial version

Use this package as a library

1. Depend on it

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


dependencies:
  imgur: ^1.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:imgur/imgur.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
58
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5

Maintenance issues and suggestions

Fix analysis_options.yaml.

The analyzer can't parse analysis_options.yaml.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and imgur.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0
http ^0.12.0+2 0.12.0+4
json_annotation ^3.0.0 3.0.1
Transitive dependencies
async 2.4.0
charcode 1.1.3
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
build_runner ^1.7.1
json_serializable ^3.2.3
pedantic ^1.8.0 1.9.0
test ^1.6.0