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

插件详情v1.0.1

expansion_card

一个可自定义的 Flutter 展开卡片,支持可选的动画图像背景。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
156
喜欢数
301
Pub 分数
150

安装插件

flutter pub add expansion_card

插件介绍

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

expansion_card 包提供了一个可自定义的 Flutter 小部件,可实现带有可选动画图像背景的可折叠卡片。非常适合展示可展开内容,如常见问题解答、详细信息或交互式部分,支持流畅的动画和跨所有主要平台的响应式设计。开发者可以根据应用的 UI 自定义卡片的外观、行为和过渡效果。该包轻量且可无缝集成到现有的 Flutter 项目中。

适合场景

  • 显示常见问题部分
  • 显示详细产品信息
  • 创建交互式折叠面板
  • 以表单形式展示分层内容
  • 增强用户入门流程

主要特点

  • 可自定义的卡片样式
  • 动画图像背景
  • 平滑展开/折叠过渡
  • 跨平台支持
  • 与 Flutter 的轻松集成
  • 可配置的动画持续时间

适合对象

  • 开发交互式 UI 的开发者
  • 需要可展开内容区域的应用
  • 寻求动画卡片组件的设计人员
  • 面向多平台的项目
  • 包含动态内容的UI密集型应用

使用建议

  • 大量实例可能影响性能
  • 图像背景加载需要仔细优化
  • 动画设置应调整以实现流畅的用户体验
  • 有限的内置可访问性功能
  • 不适用于仅静态内容

原始 README

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

Expansion card

Open Source Love

This package provides an easy implementation of a Expansion type card where you can also add gif at the background.

How to use

import 'package:expansion_card/expansion_card.dart';

Center(
            child: ExpansionCard(
              background: Image.asset("assets/animations/sleep.gif"),
              title: Container(
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    Text(
                      "Header",
                      style: TextStyle(
                        fontFamily: 'BalooBhai',
                        fontSize: 30,
                        color: Colors.white,
                      ),
                    ),
                    Text(
                      "Sub",
                      style: TextStyle(
                          fontFamily: 'BalooBhai', fontSize: 20, color: Colors.white),
                    ),
                  ],
                ),
              ),
              children: <Widget>[
                Container(
                  margin: EdgeInsets.symmetric(horizontal: 7),
                  child: Text("Content goes over here !",
                      style: TextStyle(
                          fontFamily: 'BalooBhai',
                          fontSize: 20,
                          color: Colors.white)),
                )
              ],
            ));

Custom Usage

There are several options that allow for more control:

Properties Description
leading Define an action after slidding a button
background provide any image asset file (supports gif also)
onExpansionChanged When the tile starts expanding, this function is called with the value true. When the tile starts collapsing, this function is called with the value false.
trailing A widget to display instead of a rotating arrow icon
initiallyExpanded Specifies if the list tile is initially expanded (true) or collapsed (false, the default)


👍 Contribution

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

所属分类

源码仓库

使用此插件的项目

暂无相关数据。