wordnik 0.3.0 copy "wordnik: ^0.3.0" to clipboard
wordnik: ^0.3.0 copied to clipboard

outdatedDart 1 only

Wordnik API for Dart

example/lib/example.dart

// These are only required for the API key import; they aren't necessary for the API
import 'dart:convert';
import 'dart:io';

import 'package:wordnik/wordnik.dart';

void main() async {
  // This isn't required, but you'll need to provide the API key in some way
  Map<String, dynamic> credentials = json.decode(await File('credentials.json').readAsString());

  Wordnik wordnik = Wordnik(credentials['api_key']);

  WordObject randomWord = await wordnik.getRandomWord();
  print(randomWord.word);

  // TODO: complete example
}