draw 1.1.0 copy "draw: ^1.1.0" to clipboard
draw: ^1.1.0 copied to clipboard

A fully-featured Reddit API wrapper for Dart, inspired by PRAW.

example/example.dart

// Copyright (c) 2018, the Dart Reddit API Wrapper project authors.
// Please see the AUTHORS file for details. All rights reserved.
// Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.

import 'dart:async';
import 'package:draw/draw.dart';

String? kClientId;
String? kSecret;
String? kAgentName;

Future<void> main() async {
  // Create the `Reddit` instance and authenticate
  final reddit = await Reddit.createScriptInstance(
    clientId: kClientId,
    clientSecret: kSecret,
    userAgent: kAgentName,
    username: 'DRAWApiOfficial',
    password: 'hunter12', // Fake
  );

  // Retrieve information for the currently authenticated user
  final currentUser = (await reddit.user.me()) as Redditor;
  // Outputs: My name is DRAWApiOfficial
  print('My name is ${currentUser.displayName}');
}
20
likes
115
pub points
65%
popularity

Publisher

unverified uploader

A fully-featured Reddit API wrapper for Dart, inspired by PRAW.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

collection, color, http, http_parser, ini, logging, oauth2, path, quiver

More

Packages that depend on draw