dartwitter 0.0.5

  • Readme
  • Changelog
  • Installing
  • 48

A Twitter API client library for Dart developers.

Just developing, not testing 😇

Usage #

Authorization

import 'dart:io';

import 'package:dartwitter/dartwitter.dart';
import 'package:dartwitter/models.dart' as models;

void main() {
  authorize().then((token) => print(token));
}

Future<models.AccessToken> authorize() async {
  var handler = Auth1Handler('api_key', 'api_key_secret');
  var url = await handler.getAuthorizationUrl();
  print(url);
  var verifier = stdin.readLineSync();
  return await handler.getAccessToken(verifier);
}

A simple usage example:

import 'package:dartwitter/dartwitter.dart';
import 'package:dartwitter/models.dart' as models;

void main() {
  var handler = OAuth1Handler('api_key', 'api_key_secret');
  handler.accessToken =
      models.AccessToken('access_token', 'access_token_secret');

  var api = Api(handler);
  api.getUser(screenName: 'mertcandinler0').then((object) => print(object));
}

Created from templates made available by Stagehand under a BSD-style license.

0.0.5 #

  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

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


dependencies:
  dartwitter: ^0.0.5

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

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

  • Dart: 2.8.4
  • pana: 0.13.15

Analysis suggestions

Package not compatible with runtime flutter-web on Web

Because:

  • package:dartwitter/dartwitter.dart that imports:
  • package:dartwitter/src/auth/oauth1_handler.dart that imports:
  • package:oauth1_client/oauth1_client.dart that imports:
  • package:oauth1_client/src/oauth1_client_base.dart that imports:
  • package:oauth1_client/src/client.dart that imports:
  • dart:io

Package not compatible with runtime js

Because:

  • package:dartwitter/dartwitter.dart that imports:
  • package:dartwitter/src/auth/oauth1_handler.dart that imports:
  • package:oauth1_client/oauth1_client.dart that imports:
  • package:oauth1_client/src/oauth1_client_base.dart that imports:
  • package:oauth1_client/src/client.dart that imports:
  • dart:io

Health suggestions

Fix lib/src/models/entities.dart. (-2.48 points)

Analysis of lib/src/models/entities.dart reported 5 hints:

line 88 col 19: The declaration 'fromJson' isn't referenced.

line 140 col 19: The declaration 'fromJson' isn't referenced.

line 183 col 18: The declaration 'fromJson' isn't referenced.

line 230 col 22: The declaration 'fromJson' isn't referenced.

line 290 col 15: The declaration 'fromJson' isn't referenced.

Fix lib/src/models/relationship.dart. (-1 points)

Analysis of lib/src/models/relationship.dart reported 2 hints:

line 75 col 17: The declaration 'fromMap' isn't referenced.

line 140 col 18: The declaration 'fromJson' isn't referenced.

Maintenance suggestions

The package description is too short. (-11 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.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

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

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
http ^0.12.0+4 0.12.1
oauth1_client ^1.0.0 1.0.0
Transitive dependencies
charcode 1.1.3
collection 1.14.13 1.15.0-nullsafety
convert 2.1.1
crypto 2.1.5
http_parser 3.1.4
meta 1.2.2 1.3.0-nullsafety
path 1.7.0
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0 1.3.0-nullsafety
Dev dependencies
build_runner ^1.8.1
pedantic ^1.8.0 1.9.2
test ^1.6.0