draw 0.0.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 69

DRAW: The Dart Reddit API Wrapper

Build Status Pub Version

DRAW, also known as the Dart Reddit API Wrapper, is a Dart package that provides simple access to the Reddit API. DRAW is inspired by PRAW, the Python Reddit API Wrapper, and aims to also maintain a similar interface.

This project is in early stages, but is in active development. Check back soon for more info!

Disclaimer: This is not an official Google product.

Installation

Installing DRAW is simple using Dart's package management system, pub. Instructions on how to import DRAW into your project can be found here. If you would prefer to live on the hemorrhaging-edge, methods to depend on a local copy of DRAW or on the Github repository can be found here.

Getting Started

Assuming you already have your Reddit OAuth credentials, getting started with DRAW is simple:

import 'dart:async';                                                                                                                                                                                               
import 'package:draw/draw.dart';                                                                                                                                                                                   
                                                                                                                                                                                                                   
Future main() async {                                                                                                                                                                                              
  // Create the `Reddit` instance and authenticate                                                                                                                                                                 
  Reddit reddit = await Reddit.createInstance(                                                                                                                                                                     
    clientId: CLIENT_ID,                                                                                                                                                                                           
    clientSecret: SECRET,                                                                                                                                                                                          
    userAgent: AGENT_NAME,                                                                                                                                                                                         
    username: "DRAWApiOfficial",                                                                                                                                                                                   
    password: "hunter12", // Fake                                                                                                                                                                                  
  );                                                                                                                                                                                                               
                                                                                                                                                                                                                   
  // Retrieve information for the currently authenticated user                                                                                                                                                     
  Redditor currentUser = await reddit.user.me();                                                                                                                                                                                                                                                                                                                                                                                      
  // Outputs: My name is DRAWApiOfficial                                                                                                                                                                           
  print("My name is ${currentUser.displayName}");                                                                                                                                                                  
} 

This simple example is a great way to confirm that DRAW is working and that your credentials have been configured correctly.

License

DRAW is provided under a BSD 3-clause license. Copyright (c), 2017, the DRAW Project Authors and Google LLC.

Change Log

Version 0.0.3 (2018/01/22)

Minor changes and bug fixes:

  • Fixed bug that caused authentication to fail when using draw.ini with the ScriptAuthenticator
  • Refactored DRAWConfigContext

Version 0.0.2 (2017/12/15)

Minor updates:

  • Added CHANGELOG.md
  • Formatted sample code in README.md
  • Renamed .analysis_options to analysis_options.yaml
  • Documentation added for classes and methods that had none
  • Commented out currently unimplemented functionality to clean up generated documents

Version 0.0.1 (2017/12/08)

Initial release with basic functionality, including:

  • OAuth2 support for login
  • Comment, Redditor, and Subreddit interfaces

1. Depend on it

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


dependencies:
  draw: "^0.0.3"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:draw/draw.dart';
        
Version Uploaded Documentation Archive
0.0.3 Jan 23, 2018 Go to the documentation of draw 0.0.3 Download draw 0.0.3 archive
0.0.2 Dec 15, 2017 Go to the documentation of draw 0.0.2 Download draw 0.0.2 archive
0.0.1 Dec 12, 2017 Go to the documentation of draw 0.0.1 Download draw 0.0.1 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
39 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
69

Platforms

Detected platforms: Flutter, other

Primary library: package:draw/draw.dart with components: io.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use draw.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
collection ^1.14.3 1.14.5
http ^0.11.3+14 0.11.3+16
ini ^1.1.0 1.1.0
oauth2 ^1.1.0 1.1.0
path ^1.4.2 1.5.1
quiver >=0.26.2 <0.27.0 0.26.2 0.28.0
Transitive dependencies
async 2.0.3
charcode 1.1.1
http_parser 3.1.1
matcher 0.12.1+4
meta 1.1.2
source_span 1.4.0
stack_trace 1.9.1
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
mockito ^2.2.1
reply ^0.1.2-dev
test ^0.12.5