搜索插件、代码仓与 APP 分类

paperfold 封面
插件详情v1.0.4

paperfold

该包提供了一个小部件,可将其子项应用纸张折叠效果。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
21
喜欢数
34
Pub 分数
150

安装插件

flutter pub add paperfold

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Paperfold 是一个 Flutter 包,可让开发者为任何 widget 子项应用逼真的纸张折叠效果。它通过流畅的动画模拟折纸的视觉外观,通过动态、触觉交互增强用户界面。非常适合创建交互式卡片、文档预览或引人入胜的 UI 过渡效果,可在 Android、iOS、Web、macOS、Windows 和 Linux 等所有主要平台上使用。该包轻量且可通过简单的添加命令无缝集成到现有的 Flutter 项目中。

适合场景

  • 交互式卡片动画
  • 文档预览接口
  • 动态 UI 过渡
  • 应用入门屏幕
  • 创意仪表板元素
  • 由手势驱动的折叠效果

主要特点

  • 逼真的纸张折叠动画
  • 跨平台兼容性
  • 通过 pub 的简单集成
  • 可自定义折叠角度
  • 所有设备上的流畅性能
  • 支持嵌套控件

适合对象

  • 寻求视觉魅力的UI设计师
  • 开发交互式应用的开发者
  • 需要触觉反馈的项目
  • 教育类或演示类应用
  • 具有文档或卡片布局的应用程序

使用建议

  • 可能会影响低端设备的性能
  • 仅限折叠式转换
  • 不适合复杂的3D场景
  • 需要仔细的布局规划
  • 动画可能需要针对不同屏幕尺寸进行调整
  • 建议谨慎使用,以避免视觉杂乱

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Paperfold

Pub Style Style Style


This package provides a widget which applies a paper fold effect on it's child. You can choose between horizontal and vertical fold direction. The number of strips has to be at least two.

preview

Getting started

Installation

Add paperfold as a dependency in your pubspec.yaml file. Or run pub add paperfold in your terminal.

Usage

Just add the widget to your tree and you're done :). Take a look at example to see more.

PaperFold(
  mainAxis: PaperFoldMainAxis.vertical,
  strips: 4,
  foldValue: .5,
  pixelRatio: 1,//works best if you query the device pixel ration with MediaQuery.of
  child: ClipRRect(
    borderRadius: BorderRadius.all(Radius.circular(20)),
    child: Container(
      color: Colors.green,
      height: 150,
      child: ListView.builder(
        itemCount: 30,
        itemBuilder: (context, index) {
          return Column(
            children: [
              Row(
                children: const [
                  Icon(
                    Icons.translate,
                    size: 50,
                  ),
                  Text("hello world, hello world")
                ],
              ),
            ],
          );
        },
      ),
    ),
  ),
);

Limitation

  • User interactions (gestures etc.) with child only possible in unfold state. (0 <= fold value < 1)
  • Child widgets can't be animated. This is also valid for videos. You can wrap it by the paperfold, but the content will not update in folded state.

Issues

Feel free to file any issues, bugs, or feature requests. All contributions are welcome :)

License

BSD-3-Clause

Special thx

Special thanks to GwaedGlas for reviewing and sparring this package

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。