搜索插件、代码仓与 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).

所属分类

源码仓库

使用此插件的项目