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

photo_card_swiper 封面
套件詳情v0.0.6

photo_card_swiper

一個簡單的 Flutter 套件,用於建立照片清單的滑動卡片版面。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
18
喜歡數
43
Pub 分數
130

安裝套件

flutter pub add photo_card_swiper

套件介紹

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

一個輕量級的Flutter套件,專為建立可滑動的卡片介面以顯示照片清單而設計,靈感來自Tinder風格的互動。它支援流暢的水平滑動與直覺的手勢操作,非常適合用於相片畫廊或基於影像的內容探索。該套件支援多個平台,包括Android、iOS、Web、macOS、Windows和Linux,確保跨平台的一致性。以簡單為設計核心,能輕鬆整合至現有的Flutter專案,設定需求極少。

適用情境

  • 照片畫廊
  • 圖像瀏覽應用
  • 類似Tinder的介面
  • 內容發現功能
  • 社交媒體訊息
  • 視覺敘事應用

主要特色

  • 向左/向右滑動手勢
  • 流暢的動畫過渡
  • 跨平台支援
  • 簡單 API 結合
  • 可自訂的卡片外觀
  • 內建手勢辨識

適合對象

  • 開發圖像密集型應用的開發者
  • 需要可滑動卡片UI的專案
  • 帶有視覺內容的行動和網路應用
  • 原型設計互動版面
  • 使用者驅動內容選擇的應用程式

使用建議

  • 超出基本樣式的自訂功能有限
  • 無內建影像載入(需外部套件)
  • 可能需要對大型圖像清單進行效能優化
  • 不適合複雜的拖放互動
  • 依賴外部相依性進行影像處理

原始 README

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

photo_card_swiper

Language: English

A simple flutter package for creating a swiping card layout for list of photos.

photo_card_swiper is a photo slider resembling card stack. Card comprises options to reflect like, dislike and favorite feature. The card elements are highly customisable. This layout is quite common in social media apps like Instagram, tinder etc.

Technical Notes:

The layout for pages is built using stack of draggable widgets using LayoutBuilder. This package supports cards to be tapped too. Dev have options show 2 or 3 buttons, change the color, icon name and icon color of those buttons too.

How to use it.

the usage is very simple, just use the following code for default rendering of photos. Default values for Icons and Colors are taken care for easy usage.

PhotoCardSwiper(
     photos: widget._photos,
     showLoading: false,
 ),

or use the following with customizations

 PhotoCardSwiper(
     photos: widget._photos,
     showLoading: true,
     hideCenterButton: false,
     leftButtonIcon: Icons.close,
     rightButtonIcon: Icons.check,
     centerButtonIcon: Icons.favorite,
     leftButtonBackgroundColor: Colors.red[100],
     rightButtonBackgroundColor: Colors.lightGreen[100],
     centerButtonBackgroundColor: Colors.lightBlue[50],
     leftButtonIconColor: Colors.red[600],
     rightButtonIconColor: Colors.lightGreen[700],
     centerButtonIconColor: Colors.lightBlue[600],
     leftButtonAction: _leftButtonClicked,
     rightButtonAction: _rightButtonClicked,
     centerButtonAction: _centerButtonClicked,
     onCardTap: _onCardTap,
     cardSwiped: _cardSwiped,
 ),

Parameters for photo_card_swiper

parameter description value
photos Array of Photo data to be rendered as cards, Use PhotoCard object to group card details. [PhotoCard]()
showLoading Toggle the value to show/hide loading card This is a optional parameter. value cane be true/false
hideCenterButton Use this to have only 2 action buttons. This is a optional parameter. Pass either true/false
leftButtonIcon Left button Icon This is a optional parameter. Pass IconData type value
rightButtonIcon Right button Icon This is a optional parameter. Pass IconData type value
centerButtonIcon Center button Icon This is a optional parameter. Pass IconData type value
leftButtonBackgroundColor Left button Background Color This is a optional parameter. Pass Color type value
rightButtonBackgroundColor Right button Background Color This is a optional parameter. Pass Color type value
centerButtonBackgroundColor Center button Background Color This is a optional parameter. Pass Color type value
leftButtonIconColor Left button Icon Color This is a optional parameter. Pass Color type value
rightButtonIconColor Right button Icon Color This is a optional parameter. Pass Color type value
centerButtonIconColor Center button Icon Color This is a optional parameter. Pass Color type value
leftButtonAction Left button click handler This is a optional parameter. Pass method to be called on click.
rightButtonAction Right button click handler This is a optional parameter. Pass method to be called on click.
centerButtonAction Center button click handler This is a optional parameter. Pass method to be called on click.
onCardTap Background color of Tabbar This is a optional parameter. Example pass method with completion handler. (int _index) { }
cardSwiped Background color of Tabbar This is a optional parameter. Example pass method with completion handler. (CardActionDirection _direction, int _index) { }

Attributes/Properties of PhotoCard

parameter description default
title String to be displayed in title Text widget empty string
description String to be displayed in description Text widget empty string
imagePath Image path of image, either local assets folder image or http image path empty string
isLocalImage Value is true if imagePath is local assets folder image, Value is true if imagePath is http image path true

Please note try to load max of 10 photos at one time. This helps stack to be neat. To show more photos load them on pagination basis using cardSwiped method.

The usage is well described in the example code.

git repo here

Made with ❤ and dedicated with respect to the Saviour Sonu Sood

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。