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

animation_list 封面
插件详情v3.1.0

animation_list

一个 Flutter 包项目,包含一个简单的动画 ListView 小部件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
1220
喜欢数
76
Pub 分数
150

安装插件

flutter pub add animation_list

插件介绍

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

一个 Flutter 包,提供了一个简单的动画 ListView 小部件,可在列表项出现在屏幕上时实现平滑的进入动画。专为希望在列表渲染过程中通过细微的视觉反馈提升用户体验的开发者设计。该包支持 Android、iOS、Web、macOS、Windows 和 Linux 多个平台,适用于跨平台应用。可通过 pub add 命令轻松集成,旨在兼顾性能与简洁性。

适合场景

  • 为动态列表添加入口动画
  • 增强可滚动内容中的用户界面参与度
  • 创建视觉上吸引人的引导屏幕
  • 改进数据密集型界面中的用户反馈

主要特点

  • 平滑的项目进入动画
  • 跨平台兼容性
  • 与 pub 的简单集成
  • 轻量且高效
  • 可自定义的动画时序
  • 支持标准 ListView 功能

适合对象

  • 寻求视觉精致的UI设计师
  • 开发交互式列表的开发者
  • 需要引人入胜的滚动效果的应用程序
  • 针对多个平台的项目

使用建议

  • 在非常大的列表上可能会影响性能
  • 超出基本动画之外的自定义功能有限
  • 依赖 Flutter 的动画框架
  • 不适合复杂的过渡逻辑

原始 README

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

Animation List

A simple animation listview widget.
When it is built, list item is shown by sliding and bouncing.

⚙ Preview


⚡ Installation

Add animation_list: ^3.1.0 to your pubspec.yaml dependecies. And import it:

import 'package:animation_list/animation_list.dart';

ℹ️ How to use

Simply add a Animation List widget with required params.

final List<Map<String, dynamic>> data = [
    {
      'title': '1111',
      'backgroundColor': Colors.grey,
    },
    {
      'title': '2222',
      'backgroundColor': Colors.red,
    },
    {
      'title': '3333',
      'backgroundColor': Colors.yellow,
    },
    {
      'title': '4444',
      'backgroundColor': Colors.blue,
    },
    {
      'title': '5555',
      'backgroundColor': Colors.green,
    },
    {
      'title': '6666',
      'backgroundColor': Colors.orange,
    },
    {
      'title': '7777',
      'backgroundColor': Colors.brown,
    },
    {
      'title': '8888',
      'backgroundColor': Colors.purple,
    },
  ];

  Widget _buildTile(String title, Color backgroundColor) {
    return Container(
        height: 100,
        margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
        decoration: BoxDecoration(
          borderRadius: BorderRadius.all(Radius.circular(25)),
          color: backgroundColor,
        ));
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: AnimationList(
            animationDirection: AnimationDirection.horizontal,
            duration: 1000,
            reBounceDepth: 10.0,
            children: data.map((item) {
              return _buildTile(item['title'], item['backgroundColor']);
            }).toList()),
      ),
    );
  }

🔧 Properties

Attribute Data type Description Default
key Key Controls how one widget replaces another widget in the tree -
controller ScrollController An object that can be used to control the position to which this scroll view is scrolled -
primary bool Whether this is the primary scroll view associated with the parent PrimaryScrollController -
physics ScrollPhysics How the scroll view should respond to user input -
shrinkWrap bool Whether the extent of the scroll view in the scrollDirection should be determined by the contents being viewed false
padding EdgeInsetsGeometry The amount of space by which to inset the children -
cacheExtent double The viewport has an area before and after the visible area to cache items that are about to become visible when the user scrolls -
children List The children are required to fill the ListView []
semanticChildCount int The number of children that will contribute semantic information -
dragStartBehavior DragStartBehavior Determines the way that drag start behavior is handled DragStartBehavior.start
keyboardDismissBehavior Key ScrollViewKeyboardDismissBehavior the defines how this ScrollView will dismiss the keyboard automatically ScrollViewKeyboardDismissBehavior.manual
restorationId String Restoration ID to save and restore the scroll offset of the scrollable -
clipBehavior Clip The content will be clipped (or not) according to this option Clip.hardEdge
duration int The milliseconds the animation runs 1300
reBounceDepth double A value of bounce depth 10.0
opacityRange Tween A Tween value of opacity animation range Tween(begin: 0.3, end: 1.0)
animationDirection AnimationDirection A animation direction(vertical / horizontal / both) AnimationDirection.vertical

🤗 Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request if you have a way to improve this project.

Make sure your request is meaningful and you have tested the app locally before submitting a pull request.

🙋‍♂️ Support

💙 If you like this project, give it a ⭐ and share it with friends!

buymeacoffee-violet-badge

所属分类

源码仓库

使用此插件的项目

暂无相关数据。