do_dart 0.1.6

  • Readme
  • Changelog
  • Example
  • Installing
  • 60

do_dart BETA #

Pub support

A Dart SDK for the DigitalOcean Api v2

dependencies:
  do_dart: ^0.1.4 #latest version

Easy to use #

To get started, you need a DigitalOcean API key with sufficient privileges for the tasks you want to perform.

Then: Initializing the client

import 'package:do_dart/do_dart.dart';

Client client = Client(<DigitalOcean API Key>);

Examples #

Initializing the client

import 'package:do_dart/do_dart.dart';

Client client = Client(<DigitalOcean API Key>);

Creating a droplet

DropletCreateRequest dcr =
        DropletCreateRequest("test-droplet", 'nyc1', 's-1vcpu-1gb', 43515152, ssh_keys: [<SSH KEY ID or Fingerprint]);

Droplet d = await client.droplet.create(dcr);

The license is MIT.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

[0.1.6]

  • Fixed collection literals (formatting)

[0.1.5]

  • Fixed formatting
  • Remove unnecessary type annotations

[0.1.4]

  • Move HTTP client to dart:io package
  • Type inference fix
  • Added missing function to delete image
  • Cleanup

[0.1.3]

  • Fix owner_id field type in project (thanks to @mponkin)

[0.1.2]

  • Added a Flutter example
  • Fixed type errors in Droplet model

[0.1.1]

  • Implemented dartfmt suggestions

[0.1.0]

  • Beta release

Resource not implemented yet: #

  • Kubernetes
  • Load Balancers
  • Databases

example/main.dart

import 'package:do_dart/do_dart.dart';
import 'dart:io' show Platform, sleep;

void main() async {
  var envVars = Platform.environment;
  var client = Client(envVars['DO_KEY']);

  var account = await client.account.get();

  print(account.toString());
}

Use this package as a library

1. Depend on it

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


dependencies:
  do_dart: ^0.1.6

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:do_dart/do_dart.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
20
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]
60
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.4

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
dotenv ^2.0.0 2.0.0
json_annotation ^3.0.0 3.0.1
Transitive dependencies
args 1.5.2
dart2_constant 1.0.2+dart2
meta 1.1.8
Dev dependencies
build_runner ^1.0.0
json_serializable ^3.0.0
test ^1.5.3