Last updated:
0 purchases
free dictionary api v2
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
copied to clipboard
Import it:
import 'package:free_dictionary_api_v2/free_dictionary_api_v2.dart';
copied to clipboard
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);
}
copied to clipboard
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
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.