搜尋套件、儲存庫與 APP 分類

套件詳情v3.6.1+1

giphy_get

從 Giphy 中以純 Dart 程式碼選擇 EMOJI、STICKER 或 GIF。支援 Android、iOS、Web 與桌面端。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
3740
喜歡數
134
Pub 分數
140

安裝套件

flutter pub add giphy_get

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

giphy_get 是一個 Dart 套件,讓開發者能夠將 Giphy 的表情符號、貼紙和 GIF 搜尋功能直接整合到 Flutter 應用程式中。它支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,讓不同裝置上的使用者體驗保持一致。此套件提供純 Dart 實作,無需原生程式碼依賴,簡化整合與維護。它提供簡單的 API,可從 Giphy 巨大的資料庫中取得並顯示內容,非常適合強化社交或即時通訊功能。

適用情境

  • 向聊天介面添加GIF
  • 透過表情符號增強使用者表達
  • 建立貼紙選擇器元件
  • 在社交應用中整合 Giphy 搜尋
  • 建構互動式訊息功能

主要特色

  • 跨平台支援
  • 純 Dart 實現
  • GIF、表情符號和貼紙搜尋
  • 簡單的整合API
  • 無需原生程式碼

適合對象

  • 訊息應用
  • 社交媒體平台
  • 互動式 UI 組件
  • 需要表達性內容的應用程式
  • 尋求跨平台解決方案的開發者

使用建議

  • 需要互聯網連接以訪問 Giphy
  • Giphy UI 的自定選項有限
  • 取決於Giphy的API可用性
  • 高流量應用中可能需要速率限制
  • 無內建離線快取

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

🚀 New: Batch & Progressive Loading (vNEXT)

Smarter, User-Friendly GIF Loading

This release introduces a modern loading experience:

  • Batch Loading: Only visible GIFs are loaded/rendered, reducing network and memory usage. Off-screen GIFs are loaded as you scroll.
  • Progressive Loading: While a GIF loads, a blurred static thumbnail (if available) is shown, then swapped for the full GIF when ready—just like YouTube thumbnails!
  • Custom Loading/Failed Widgets: You can pass your own widgets to display while loading or on error, for a fully branded experience.
Example: Custom Loading/Failed Widgets
GiphyTabDetail(
  type: GiphyType.gifs,
  scrollController: myController,
  loadingWidget: MyCustomLoadingWidget(),
  failedWidget: MyCustomFailedWidget(),
)
How it works
  • The grid uses a lazy builder, so only visible GIFs are loaded.
  • Each GIF first shows a blurred static image (if available) as a placeholder, then swaps in the full GIF when loaded.
  • This keeps users confident that something is happening, even on slow networks.

See the documentation in GiphyTabDetail and GiphyGifWidget for more details.

giphy_get

Flutter_Tests pub package pub package style: lint

Overview

This package allow to get gifs, sticker or emojis from GIPHY in pure dart code using Giphy SDK design guidelines.

Inspiration
Result

Getting Started

Important! you must register your app at Giphy Develepers and get your APIKEY

Localizations

Currently english and spanish is supported.

return MaterialApp(
      title: 'Giphy Get Demo',
      localizationsDelegates: [
        // Default Delegates
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,

        // Add this line
        GiphyGetUILocalizations.delegate
      ],
      supportedLocales: [
        // Your supported languages
        Locale('en', ''),
        Locale('es', ''),
        Locale('da', ''),
      ],
      home: MyHomePage(title: 'Giphy Get Demo'),
      themeMode: Provider.of<ThemeProvider>(context).currentTheme,
    );
Get only Gif

This is for get gif without wrapper and tap to more

import 'package:giphy_get/giphy_get.dart';

GiphyGif gif = await GiphyGet.getGif(
  context: context, //Required
  apiKey: "your api key HERE", //Required.
  lang: GiphyLanguage.english, //Optional - Language for query.
  randomID: "abcd", // Optional - An ID/proxy for a specific user.
  tabColor:Colors.teal, // Optional- default accent color.
  debounceTimeInMilliseconds: 350, // Optional- time to pause between search keystrokes
);
Options
Value Type Description Default
lang String Use ISO 639-1 language code or use GiphyLanguage constants GiphyLanguage.english
randomID String An ID/proxy for a specific user. null
searchText String Input search hint, we recomend use flutter_18n package for translation "Search GIPHY"
tabColor Color Color for tabs and loading progress, Theme.of(context).accentColor
debounceTimeInMilliseconds int Time to pause between search keystrokes 350
showGIFs bool Whether to show the GIFs tab or not true
showStickers bool Whether to show the stickers tab or not true
showEmojis bool Whether to show the emojis tab or not true
tapTopBuilder Widget Function(BuildContext context) A custom builder for tab top. Must return a widget that will replace default Giphy-like tab top null. Displays default Giphy-like tab top
tabBottomBuilder Widget Function(BuildContext context) A custom builder for tab bottom. Must return a widget that will replace default Giphy credits logo. Note that credits are required to be shown by Giphy null. Displays default Giphy credits logo
searchAppBarBuilder Widget Function(BuildContext context,FocusNode focusNode,bool autofocus,TextEditingController textEditingController,void Function() onClearSearch) A custom builder for search app bar. Must return a widget that will replace default Giphy-like search bar input null. Displays default Giphy-like search bar input
Get Random ID
GiphyClient giphyClient = GiphyClient(apiKey: "YOUR API KEY");
String randomId = await giphyClient.getRandomId();

Widgets

Optional but this widget is required if you get more gif's of user or view on Giphy following Giphy Design guidelines

giphy

GiphyGifWidget

Params

Value Type Description Default
gif required GiphyGif GiphyGif object from stream or JSON null
giphyGetWrapper required GiphyGetWrapper instance required for tap to more null
showGiphyLabel boolean show or hide Powered by GIPHYlabel at bottom true
borderRadius BorderRadius ex: BorderRadius.circular(10) add border radius to image null
imageAlignment Alignment this widget is a STACK with Image and tap buttons this property adjust alignment Alignment.center

GiphyGetWrapper

Params

Value Type Description Default
giphy_api_key required String Your Giphy API KEY null
builder function return Stream<GiphyGif> and Instance of GiphyGetWrapper null

Methods

void getGif(String queryText,BuildContext context)

return GiphyGetWrapper(
    giphy_api_key: REPLACE_WITH YOUR_API_KEY,
    // Builder with Stream<GiphyGif> and Instance of GiphyGetWrapper
    builder: (stream, giphyGetWrapper) => StreamBuilder<GiphyGif>(
      stream: stream,
      builder: (context, snapshot) {
        return Scaffold(
          body: snapshot.hasData
              ? SizedBox(
                // GiphyGifWidget with tap to more
                child: GiphyGifWidget(
                  imageAlignment: Alignment.center,
                  gif: snapshot.data,
                  giphyGetWrapper: giphyGetWrapper,
                  borderRadius: BorderRadius.circular(30),
                  showGiphyLabel: true,
                ),
              )
              : Text("No GIF"),
          floatingActionButton: FloatingActionButton(
            onPressed: () async {
              //Open Giphy Sheet
              giphyGetWrapper.getGif('', context);
            },
            tooltip: 'Open Sticker',
            child: Icon(Icons
                .insert_emoticon)),
        );
    })

    });

Example APP

First export your giphy api key

export GIPHY_API_KEY=YOUR_GIPHY_API_KEY

and ther run.

Contrib

Feel free to make any PR's

所屬分類

依賴

依賴清單 6 項

原始碼儲存庫

使用此套件的專案