Add a powerful and customizable GIPHY picker into your Flutter app.

Overview

enough_giphy_flutter

Add a powerful and customizable GIPHY picker into your Flutter app.

Benefits

Using enough_giphy_flutter has the following benefits:

  • The mandatory GIPHY attribution is not an afterthought - use it "as is" to get your app approved or customize the attribution according to your needs.
  • Platform-specific UI: use cupertino look and feel on iOS and MacOS, material on Android and other platforms.
  • Easily localize all texts.
  • Customize the look and feel according to your preferences and style.
  • Uses as few dependencies as possible.

Installation

Add this dependency your pubspec.yaml file:

dependencies:
  enough_giphy_flutter: ^0.2.1

The latest version or enough_giphy_flutter is enough_giphy_flutter version.

API Documentation

Check out the full API documentation at https://pub.dev/documentation/enough_giphy_flutter/latest/

Usage

Use enough_giphy_flutter to select a GIF, sticker or emoji from GIPHY.

Requirements

Pick a GIF, Sticker or Emoji

Use Giphy.getGif(...) to pick a GIF, sticker or emoji.

import 'package:enough_giphy_flutter/enough_giphy_flutter.dart';
[...]
  @override
  Widget build(BuildContext context) {
      return TextButton(
        child: Text('GIPHY'), 
        onPressend: () async {
            final gif = await Giphy.getGif(context: context, apiKey: '123abc123');
            if (gif != null) {
                // the user has selected a GIF, now handle it in your own way.
                // Example: display gif using the GiphyImageView:
                showDialog(
                    context: context,
                    builder: (context) => AlertDialog(
                        title: Text(gif.title),
                        content: GiphyImageView(
                            gif: gif,
                        ),
                    ),
                );
            }
        },
      );
  }

Choose What to Pick

  • Set the type parameter to switch between gifs, stickers and emoji, e.g.
final gif = await Giphy.getGif(
    context: context, 
    apiKey: 'abc123abc',
    type: GiphyType.stickers, 
);
final gif = await Giphy.getGif(
    context: context, 
    apiKey: 'abc123abc',
    type: GiphyType.stickers,
    lang: GiphyLanguage.german, 
);
  • Use the rating parameter to show other than 'all ages' content:
final gif = await Giphy.getGif(
    context: context, 
    apiKey: 'abc123abc',
    type: GiphyType.gifs,
    lang: GiphyLanguage.spanish, 
    rating: GiphyRating.pg13,
);

Localize

Localize texts with the following String parameters of the getGif() method:

  • searchLabelText
  • searchHintText
  • searchEmptyResultText
  • headerGifsText
  • headerStickersText
  • headerEmojiText You can also define an errorBuilder callback to display a localized error message:
// example for localizing text in German:
final gif = await Giphy.getGif(
    context: context, 
    apiKey: 'abc123abc',
    type: GiphyType.gifs,
    lang: GiphyLanguage.german, 
    rating: GiphyRating.g,
    searchLabelText: 'GIPHY Suche',
    searchHintText: 'Deine Suchanfrage',
    searchEmptyResultText: 'Nichts gefunden...',
    headerGifsText: 'GIFs',
    headerStickersText: 'Sticker',
    headerEmojiText: 'Emoticons',
    errorBuilder: (context, error, stacktrace) => 
        const Center(child: Text('Leider gab es einen Fehler,\nbitte probiere es später noch einmal.')),
);

Preview

You can show a confirmation dialog before a gif is selected by setting the showPreview parameter to true:

final gif = await Giphy.getGif(
    context: context, 
    apiKey: 'abc123abc',
    showPreview: true,
);

The preview is either a material AlertDialog or a CupertinoAlertDialog depending on the platform. This dialog will show the title and - if available - the creator of the gif. You can search for other gifs of the same creator by tapping on the creator's name.

Attribution

With enough_giphy_flutter your app automatically fulfills the GIPHY Attribution Policy:

  • A GIPHY logo is shown next to the search field
  • The preview dialog shows the creator of the selected gif.

If you want to show a different attribution, set the Widget? attribution parameter, e.g.:

final gif = await Giphy.getGif(
    context: context, 
    apiKey: 'abc123abc',
    attribution: Image.asset('assets/images/giphy.gif', height: 40),
);

To hide the attribution, set showAttribution to false:

final gif = await Giphy.getGif(
    context: context, 
    apiKey: 'abc123abc',
    showAttribution: false,
);

Customize UI

Apart from the above can customize a lot of things, e.g.

  • Set gridType to GridType.squareFixedColumns or GridType.squareFixedWidth to use square tiles instead of the default stacked tiles. Or even specify your own gridBuilder to create your very own representation.
  • Adapt the spacing between columns using [gridSpacing], defaults to 4.0.
  • Adapt the minimum number of columns shown with [gridMinColumns], which defaults to 2.
  • Create your own gridBorderRadius or set it to null to adapt the border of the shown GIFs in the grid to your liking.
  • Disable search by setting [showSearch] to false.
  • Disable the user switchting between gifs, stickers and emojy by setting [showTypeSwitcher] to false.
  • Enable showing a high quality preview before returning a selection by setting [showPreview] to true.
  • Set [showAttribution] to false to hide the attribution or specify your own attribution witdget with [attribution].
  • Enable keeping the state of the currently selected type and search between invocations by setting [keepState] to true.
  • Show you own UI on top of the GIPHY sheet after the user has selected a [GiphyGif] by setting your custom [onSelected] callback.
  • Create your own previewBorderRadius or set it to null to adapt the border of the shown GIFs in the preview to your liking (remebder to set showPreview to true).

Build your own Giphy Experience

Use the widgets package to build fully customized GIPHY solutions easily. Use the API documentation and the source for guidance.

import 'package:enough_giphy_flutter/widgets.dart';

Features and bugs

Please file feature requests and bugs at the issue tracker.

License

Licensed under the commercial friendly Mozilla Public License 2.0.

You might also like...

Scan Qr Code Which Will Automatically Add That User To The Visitor List

Scan Qr Code Which Will Automatically Add That User To The Visitor List

GIGO APP Gigo app is a mobile application where shopkeepers have an app that shows QR code and users can scan this QR code which will automatically ad

Dec 30, 2022

Liquid swipe with Drawer - Liquid swipe application with full customizable drawer with govt logo

Liquid swipe with Drawer - Liquid swipe application with full customizable drawer with govt logo

Liquid swipe with Drawer Liquid swipe application with full customizable drawer

Jan 19, 2022

The Cat Vs Dog Scanner app will identify your dog's & cat's breed reliably in just a few seconds! Besides taking a picture, you can also record a video or upload an image from your gallery. The app is made with Flutter and TensorFlow Lite!

cat_vs_dog_detector A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you star

Nov 24, 2021

Prove your identity on demand and manage your finance with Flutter

Prove your identity on demand and manage your finance with Flutter

Identt-User-Flutter IdenTT Prove your identity on demand and manage your finance. View Admin Panel Demo || View App Demo About The Project Problem: Mo

May 17, 2022

Real short video app with firebase and pixels API.Where you can create a short video with pixels' stock videos and also merge your audio.

Real short video app with firebase and pixels API.Where you can create a short video with pixels' stock videos and also merge your audio.

Real short video app with firebase and pixels API.Where you can create a short video with pixels' stock videos and also merge your audio.

Dec 26, 2022

A simple app for studying the japanese vocabulary you will learn in your japanese learning journey based on cards with meaning, pronunciation and kanji.

A simple app for studying the japanese vocabulary you will learn in your japanese learning journey based on cards with meaning, pronunciation and kanji.

KanPractice A simple app for studying the japanese vocabulary you will learn in your japanese learning journey based on cards with meaning, pronunciat

Jan 3, 2023

An app to get you the latest and the trending news based on your location.

An app to get you the latest and the trending news based on your location.

Nov 11, 2022

A pokemon app that let's you explore a large libarary of pokemons, view their strenghts and save your favorite pokemons

A pokemon app that let's you explore a large libarary of pokemons, view their strenghts and save your favorite pokemons

A pokemon app that let's you explore a large libarary of pokemons, view their strenghts and save your favorite pokemons!. (Built using freezed and flutter_bloc)

Aug 19, 2022

Easy and Fast internationalization for your Flutter Apps

 Easy and Fast internationalization for your Flutter Apps

Easy and Fast internationalization for your Flutter Apps Why easy_localization? 🚀 Easy translations for many languages 🔌 Load translations as JSON,

Dec 18, 2022
Owner
null
A package that allows you to add native drag and drop support into your flutter app.

native_drag_n_drop A package that allows you to add native drag and drop support into your flutter app. Currently supported features Support iPadOS 11

Alex Rabin 21 Dec 21, 2022
🛒 A simple Shop App to browse, add your own products, add products to cart and later order them.

?? A simple Shop App to browse, add your own products, add products to cart and later order them.

Hemant Rajput 2 Jun 8, 2022
Package your Flutter app into OS-specific bundles (.app, .exe, etc.) via Dart or the command line.

flutter_app_packager Package your Flutter app into OS-specific bundles (.app, .exe, etc.) via Dart or the command line. The flutter_app_packager sourc

LeanFlutter 415 Jan 8, 2023
Spyxpo Web to App Builder - a tool which is used to convert a website into an app for iOS, Android, Windows, macOS and Linux.

Spyxpo Web to App Builder Convert any website into an iOS/Android app. This is a preview build for testing purposes major update coming soon. Supporte

Spyxpo 4 Aug 24, 2022
A re-modding of the Flutter 2.5 Skeleton App Template into something that really equally shows flutter best practices in DevOPS, OOP, and UX.

A re-modding of the Flutter 2.5 Skeleton App Template into something that really equally shows flutter best practices in DevOPS, OOP, and UX.

Fred Grott 20 Dec 22, 2022
A simple but powerful path-based navigation router with full web-browser and deeplink support.

nav_stack A simple but powerful path-based routing system, based on MaterialApp.router (Nav 2.0). It has browser / deeplink support and maintains a hi

gskinner team 22 Nov 28, 2022
A simple but powerful path-based navigation router with full web-browser and deeplink support.

nav_stack A simple but powerful path-based routing system, based on MaterialApp.router (Nav 2.0). It has browser / deeplink support and maintains a hi

gskinner team 22 Nov 28, 2022
Learn how to incorporate Firebase into our Flutter apps

Flash Chat ⚡️ Our Goal The objective of this tutorial is to learn how to incorporate Firebase into our Flutter apps. We'll be using Firebase Cloud Fir

null 0 Oct 27, 2021
A flutter app where the user could add their credit cards and see a summary of their expenses

Card Controller ?? Card Controller foi um projeto realizado com o intuito de aprendizagem e prática da linguagem de programação Dart em conjunto com o

null 3 Jul 26, 2022
A simple, interactive and customizable on-tap bounce animation that can be wrapped on any widgets that you like.

A simple, interactive and customizable on-tap bounce animation that can be wrapped on any widgets that you like.

null 16 Nov 2, 2022