Skip to content

An opinionated yet customizable Flutter package for searching and selecting from a list of GIFs/Stickers from the Klipy GIF search API.

License

Notifications You must be signed in to change notification settings

Flyclops/klipy_flutter

 
 

Repository files navigation

⚠️ NOT MAINTAINED ⚠️

After exploring the option of using KLIPY we have decided against it.

If you are interested in taking over this repo and package please do not hesitate to reach out via the issues and we will get it sorted out.

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. It is currently using the migration from Tenor option.

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.

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 🙏

About

An opinionated yet customizable Flutter package for searching and selecting from a list of GIFs/Stickers from the Klipy GIF search API.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dart 61.0%
  • C++ 17.8%
  • CMake 15.0%
  • Ruby 2.2%
  • HTML 1.4%
  • Swift 1.4%
  • Other 1.2%