Skip to content

tyypgzl/free_dictionary_api_v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Word not found. You can search for another word.

  • FreeDictionaryExceptionType.rateLimit

You can send 450 requests in 5 minutes with the same IP address.

  • FreeDictionaryExceptionType.server

An error occurred on the server. Try again later.

  • FreeDictionaryExceptionType.unexcepted

Something went wrong.

For more API documentation

visit Offical Site visit Github

Releases

No releases published

Packages

No packages published

Languages