free_dictionary_api_v2 1.0.1 copy "free_dictionary_api_v2: ^1.0.1" to clipboard
free_dictionary_api_v2: ^1.0.1 copied to clipboard

Package to access the https://dictionaryapi.dev

Free Dictionary Api #

Package to access the Free Dictionary API over HTTP.

Getting Started #

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  free_dictionary_api_v2: ^latest

Import it:

import 'package:free_dictionary_api_v2/free_dictionary_api_v2.dart';

Usage Examples #

Create the FreeDictionaryApiV2 object as follows and get response with getDefinition function. This function returns FreeDictionaryResponse list. If there is an error, it throws a FreeDictionaryException.

  try {
    final dictionary = FreeDictionaryApiV2();
    final response = await dictionary.getDefinition('hello');
  } on FreeDictionaryException catch (error, stackTrace) {
    log('FreeDictionaryException:', error: error, stackTrace: stackTrace);
  }

Error Handling #

API throws FreeDictionaryException in incorrect cases.

Types #

FreeDictionaryExceptionType.noDefinitionFound

For more API documentation #

visit Offical Site visit Github

4
likes
0
points
15
downloads

Publisher

verified publishertguzel.dev

Weekly Downloads

Package to access the https://dictionaryapi.dev

Repository (GitHub)
View/report issues

Topics

#api #english #dictionary

License

unknown (license)

Dependencies

http

More

Packages that depend on free_dictionary_api_v2