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

套件詳情v2.0.4

page_view_indicator

從任何 Widget 和/或 Animation 建立 PageView 的指示標記。

近 30 天下載
257
喜歡數
31
Pub 分數
35

安裝套件

flutter pub add page_view_indicator

套件介紹

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

一個 Flutter 套件,為 PageView 小部件提供可自訂的指示標記,允許開發者使用任何 Widget 或 Animation 作為視覺指示器。它透過清楚顯示滾動頁面清單中的目前頁面位置來提升使用者體驗。此套件輕巧且彈性,支援自訂樣式與動態動畫。非常適合用於引導流程、圖片滑塊和導覽巡禮。

適用情境

  • 入門畫面
  • 圖片滑塊
  • 導覽遊
  • 表單向導
  • 內容輪播

主要特色

  • 可自訂的小部件指示器
  • 支援動畫
  • 靈活的樣式
  • 與 PageView 的輕鬆整合
  • 輕量且高效

適合對象

  • 行動應用程式入門
  • 圖像畫廊
  • 互動式教程
  • 動態內容顯示
  • 使用者介面增強

使用建議

  • 需要使用 PageController 手動設定
  • 有限的平台特定優化
  • 無內建輔助功能
  • 可能需要額外的樣式來實現複雜的設計
  • 依賴外部動畫邏輯

原始 README

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

PageViewIndicator Pub Package

Builds indication marks for PageView.

Import

import 'package:page_view_indicator/page_view_indicator.dart';

Usage

Default Material behavior
return PageViewIndicator(
  pageIndexNotifier: pageIndexNotifier,
  length: length,
  normalBuilder: (animationController, index) => Circle(
        size: 8.0,
        color: Colors.black87,
      ),
  highlightedBuilder: (animationController, index) => ScaleTransition(
        scale: CurvedAnimation(
          parent: animationController,
          curve: Curves.ease,
        ),
        child: Circle(
          size: 12.0,
          color: Colors.black45,
        ),
      ),
);

Example 1


Custom animations
return PageViewIndicator(
  pageIndexNotifier: pageIndexNotifier,
  length: length,
  normalBuilder: (animationController, index) => Circle(
        size: 8.0,
        color: Colors.black87,
      ),
  highlightedBuilder: (animationController, index) => ScaleTransition(
        scale: CurvedAnimation(
          parent: animationController,
          curve: Curves.ease,
        ),
        child: Circle(
          size: 8.0,
          color: Colors.white,
        ),
      ),
);

Example 2


Custom icons

It's not just about dots!

return PageViewIndicator(
  pageIndexNotifier: pageIndexNotifier,
  length: length,
  normalBuilder: (animationController, index) => ScaleTransition(
        scale: CurvedAnimation(
          parent: animationController,
          curve: Curves.ease,
        ),
        child: Icon(
          Icons.favorite,
          color: Colors.black87,
        ),
      ),
  highlightedBuilder: (animationController, index) => ScaleTransition(
        scale: CurvedAnimation(
          parent: animationController,
          curve: Curves.ease,
        ),
        child: Icon(
          Icons.star,
          color: Colors.white,
        ),
      ),
);

Example 3

Changing the space bettwen the indicators

You can change the padding around the indicators using the indicatorPadding property:

return PageViewIndicator(
  pageIndexNotifier: pageIndexNotifier,
  length: length,
  indicatorPadding: const EdgeInsets.all(4.0)
  ...

Default is const EdgeInsets.all(8.0).

所屬分類

原始碼儲存庫

使用此套件的專案