搜尋分類、套件與程式碼儲存庫

horizontal_card_pager 封面
套件詳情v1.1.1

horizontal_card_pager

使用動態且美觀的卡片視圖輪播(水平方向)來幫助您創建優秀的應用程式。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
183
喜歡數
173
Pub 分數
140

安裝套件

flutter pub add horizontal_card_pager

套件介紹

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

一個用於建立動態、視覺上吸引人的水平卡片翻頁器的Flutter套件。它能在水平佈局中實現流暢、互動式的卡片過渡,非常適合展示圖片、卡片或產品清單等內容。此翻頁器支援可自訂的動畫與跨多個平台的響應式設計。適用於需要具現代美學的引人入勝之可滑動卡片介面之應用程式。

適用情境

  • 可滑動的產品輪播
  • 圖像畫廊
  • 互動式內容滑塊
  • 入門畫面
  • 功能亮點部分
  • 使用者資料展示

主要特色

  • 橫向卡片導航
  • 流暢的動畫過渡
  • 可自訂的卡片樣式
  • 響應式設計支援
  • 跨平台相容性
  • 動態內容加載

適合對象

  • 行動應用開發者
  • UI/UX 設計師
  • 電子商務應用
  • 內容豐富的應用
  • 互動式原型

使用建議

  • 需要對大型數據集進行仔細的性能調優
  • 可能需要額外的邏輯來處理無限滾動
  • 有限的內建分頁指示器
  • 最適合中等數量的卡片
  • 未針對縱向佈局進行優化
  • 依賴外部依賴項以實現進階功能

原始 README

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

Use dynamic and beautiful card view pagers (horizontal direction) to help you create great apps.

Preview

Mobile
Web

Installing

  1. Add dependency to pubspec.yaml

    Get the latest version in the 'Installing' tab on pub.dartlang.org

dependencies:
    horizontal_card_pager: ^1.1.1
  1. Import the package
import 'package:horizontal_card_pager/horizontal_card_pager.dart';
import 'package:horizontal_card_pager/card_item.dart';
  1. Adding HorizontalCardPager

With optional parameters

HorizontalCardPager(
    initialPage : 2 // default value is 2
    onPageChanged: (page) => print("page : $page"),
    onSelectedItem: (page) => print("selected : $page"),
    items: { ... },  // set ImageCardItem or IconTitleCardItem class
))
  1. Put CardItem object in items parameter in HorizontalCardPager

If the contents of the card contain only images, use the ImageCardItem class. and If the contents of the card include an icon and a title, use the IconTitleCardItem class.

Image Icon & Text
imagetype icontitletype
ImageCardItem

class ImageCarditem extends CardItem {
  final Widget image;

  ImageCarditem({this.image});
}
IconTitleCardItem
class IconTitleCardItem extends CardItem {
  final IconData iconData;
  final String text;
  final Color selectedBgColor;
  final Color noSelectedBgColor;
  final Color selectedIconTextColor;
  final Color noSelectedIconTextColor;

  IconTitleCardItem(
      {this.iconData,
      this.text,
      this.selectedIconTextColor = Colors.white,
      this.noSelectedIconTextColor = Colors.grey,
      this.selectedBgColor = Colors.blue,
      this.noSelectedBgColor = Colors.white});
}

How to use

Check out the example app in the example directory or the 'Example' tab on pub.dartlang.org for a more complete example.

Reference

This package's animation is inspired from from this Dribbble art.

TODO

  • [x] Attach Gesture Detector
  • [x] implement call back method
  • [x] Enable to customize card design
    • [x] icon & title
    • [x] image only
  • [x] Implements sample app
  • [x] Publish plugin

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。