KLIPY Flutter

KLIPY Flutter Pub Package Build Status Coverage Status KLIPY Dart Stars License BSD 3-Clause

This package integrates KLIPY GIF search into Flutter by utilizing the klipy_dart package to communicate directly with the KLIPY API via http. We are currently using the migration from Tenor option but plan to build this package out to be feature complete with the KLIPY API.

The package currently provides an opinionated yet customizable UI experience for searching and selecting from a list of GIFs/Stickers from the KLIPY GIF search API.

KLIPY Flutter Demo

Show some ❤️ and star the repo to support this package.

What to know

  • In order to start using KLIPY Dart you must obtain an API key by registering your project with KLIPY.
  • KLIPY requires proper attribution for projects using their API. This package does not handle the attribution process, so you will need to take care of it yourself.

Obtaining KLIPY API key

  1. Log in to the partner panel
  2. Add a new platform
  3. Click Create Key
  4. Copy the generated API key
  5. Provide this API key as a parameter to KlipyClient(apiKey: 'YOUR_API_KEY')

Usage

Installation

flutter pub add klipy_flutter

Having trouble? Read the pub.dev installation page.

Import

Import the package into the dart file where it will be used:

import 'package:klipy_flutter/klipy_flutter.dart';

Initialize

You must pass in a valid apiKey provided by KLIPY.

final klipyClient = KlipyClient(apiKey: 'YOUR_API_KEY');

Example

For more elaborate examples feel free to check out example/lib/main.dart.

Here's how to display the UI as a bottom sheet and then print the user's selection. If null is returned, it means the user closed the sheet without choosing a GIF.

final klipyClient = KlipyClient(apiKey: 'YOUR_API_KEY');
final KlipyResultObject? result = await klipyClient.showAsBottomSheet(context: context);
print(result?.media.tinyGif?.url);

Migrating from tenor_flutter to klipy_flutter

  • Get an API key and update it in your app
  • Change all references of:
    • import 'package:tenor_flutter/tenor_flutter.dart'; to import 'package:klipy_flutter/klipy_flutter.dart';
    • TenorResult to KlipyResultObject
    • TenorMediaObject to KlipyMediaObject
    • TenorStyle to KlipyStyle
    • TenorSelectedCategoryStyle to KlipySelectedCategoryStyle
    • Tenor to KlipyClient
  • Remove the following parameters from Tenor/KlipyClient:
    • clientKey
      • If you would like to distinguish between projects/devices then consider creating seperate API keys under the same platform.
    • contentFilter
  • Update attribution to support KLIPY rules

Don't need the UI?

If you're seeking a solution that allows for full customization without the need of dependencies then consider KLIPY Dart.

Sponsors

Flyclops

Domino!

Flyclops is a independent mobile games studio specializing in casual multi-player games, both asynchronous turn-based, and real-time. Flyclops’s games have been played by millions across the globe.

Domino! is super addictive, fast-paced, multiplayer dominoes done right for iOS and Android. This easy-to-learn but impossible-to-master strategy game is beautifully designed and endlessly entertaining!

What's next?

  • Documentation
  • Tests (Contributions welcome) ^_^
  • Further improvements

Contributing

If you read this far then you are awesome! There are a multiple ways in which you can contribute:

  • Pick up any issue marked with "good first issue"
  • Propose any feature, enhancement
  • Report a bug
  • Fix a bug
  • Write and improve some documentation
  • Send in a Pull Request 🙏

Libraries

klipy_flutter