tenor 1.0.4 copy "tenor: ^1.0.4" to clipboard
tenor: ^1.0.4 copied to clipboard

outdated

Fetch Tenor Gifs on dart client and server + on Flutter.

Tenor #

Pub Package License: MIT Issue Forks Stars

Donate  #

Donate

Fetch, Search GIF more easily and customised manner from Tenor #

Table of Contents #

Lets Get Started #

1. Depend on it #

Add this to your package's pubspec.yaml file:

dependencies:
  tenor:

2. Install it #

You can install packages from the command line:

with pub:

$  pub get

with Flutter:

$  flutter packages get

3. Import it #

Now in your Dart code, you can use:

import 'package:tenor/tenor.dart';

Usage #

Initialize Tenor #

Initialize Tenor library

var api = Tenor(apiKey: 'ApiKey');

Fetch some Trending GiIF

//requestTrendingGIF({int limit = 1, String contentFilter = ContentFilter.off, String mediaFilter = MediaFilter.minimal});

// fetch trending GIF
TenorResponse res = await api.requestTrendingGIF(limit: 5);
res.results.forEach((tenorResult) {
  var title = tenorResult.title;
  var media = tenorResult.media;
  print('$title: gif      : ${media?.gif?.previewUrl?.toString()}');
});

Search for GIF #

Search for the GIF

//searchGIF(String search, {int limit = 1, String contentFilter = ContentFilter.off, String mediaFilter = MediaFilter.minimal});

TenorResponse res = await api.searchGIF('subscribe mrbeast', limit: 5);
res.results.forEach((tenorResult) {
  var title = tenorResult.title;
  var media = tenorResult.media;
  print('$title: gif      : ${media?.gif?.previewUrl?.toString()}');
});
Donate

Fetching Options #

key description
limit eg. limit the number of GIF to be fetched. limit can vary from 1 to 50
contentFilter default: low. (values: off, low, medium, high) specify the content safety filter level. eg. contentFilter: ContentFilter.low
mediaFilter default: minimal. (values: basic, minimal) Reduce the Number of GIF formats returned in response. minimal- (tinygif, gif, and mp4). basic- (nanomp4, tinygif, tinymp4, gif, mp4, and nanogif) eg. mediaFilter: MediaFilter.minimal

Fetch Next Set of GIF Response #

fetchNext() is used to get next set of response for the current query

// fetchNext({int limit = 1});

// here the fetchNext function is used to call next set of GIF for the current response
TenorResponse nextResult = await res.fetchNext();
print('next results');
nextResult.results.forEach((tenorResult) {
  var title = tenorResult.title;
  var media = tenorResult.media;
  print('$title: gif      : ${media?.gif?.previewUrl?.toString()}');
});

Fetching Next Options #

key description
limit eg. limit the number of GIF to be fetched. limit can vary from 1 to 50

Features coming in next version #

On-going implementation for future:

  • Some more Functions
  • Fetch Categories
  • Download GIF
16
likes
0
pub points
72%
popularity

Publisher

verified publisherjustkawal.dev

Fetch Tenor Gifs on dart client and server + on Flutter.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

collection, universal_io

More

Packages that depend on tenor