jokeapi 1.0.0 jokeapi: ^1.0.0 copied to clipboard
Get various jokes from JokeAPI without any API token, membership, registration or payment.
😂 jokeapi 😂 #
🚨 Note: due to the different types of humor, JokeAPI contains a wide variety of jokes, of which some are very offensive. They can be filtered out using the blacklistFlags or safe-mode parameters, but use this API at your own risk! #
Dart client for JokeAPI.
Get various jokes from JokeAPI without any API token, membership, registration or payment.
Usage #
import 'package:jokeapi/jokeapi.dart';
void main() async {
final jokeApi = JokeApi();
final jokes = [
...(await jokeApi.getJokes(type: JokeType.single)).jokes,
...(await jokeApi.getJokes(type: JokeType.twoPart)).jokes,
...(await jokeApi.getJokes(amount: 10)).jokes,
];
for (final joke in jokes) {
switch (joke) {
case SingleJoke():
print(joke.joke);
case TwoPartJoke():
print(joke.setup);
print(joke.delivery);
}
}
}
Planned Features #
- ❌ Error handling
- ❌ Automate API generation
- ✅ Supported endpoints
- ✅
v2.jokeapi.dev/joke/[Category/-ies]
- ✅
v2.jokeapi.dev/info
- ❌
v2.jokeapi.dev/categories
- ❌
v2.jokeapi.dev/langcode/[Language]
- ❌
v2.jokeapi.dev/languages
- ❌
v2.jokeapi.dev/flags
- ❌
v2.jokeapi.dev/formats
- ❌
v2.jokeapi.dev/ping
- ❌
v2.jokeapi.dev/endpoints
- ❌
v2.jokeapi.dev/submit
- ✅