搜索分类、插件与代码仓

horizontal_card_pager 封面
插件详情v1.1.1

horizontal_card_pager

使用动态且美观的卡片视图轮播(水平方向)来帮助您创建出色的应用程序。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
183
喜欢数
173
Pub 分数
140

安装插件

flutter pub add horizontal_card_pager

插件介绍

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

一个用于创建动态、视觉上吸引人的水平卡片滑动器的Flutter包。它可在水平布局中实现流畅、交互式的卡片过渡,非常适合展示图片、卡片或产品列表等内容。该滑动器支持可自定义的动画和跨多个平台的响应式设计。适用于需要具有现代美感的引人入胜的可滑动卡片界面的应用程序。

适合场景

  • 可滑动的产品轮播
  • 图像画廊
  • 交互式内容滑块
  • 入门屏幕
  • 功能亮点部分
  • 用户资料展示

主要特点

  • 横向卡片导航
  • 流畅的动画过渡
  • 可自定义的卡片样式
  • 响应式设计支持
  • 跨平台兼容性
  • 动态内容加载

适合对象

  • 移动应用开发者
  • UI/UX 设计师
  • 电子商务应用
  • 内容丰富的应用
  • 交互式原型

使用建议

  • 需要对大型数据集进行仔细的性能调优
  • 可能需要额外的逻辑来处理无限滚动
  • 有限的内置分页指示器
  • 最适合中等数量的卡片
  • 未针对纵向布局进行优化
  • 依赖外部依赖项以实现高级功能

原始 README

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

Use dynamic and beautiful card view pagers (horizontal direction) to help you create great apps.

Preview

Mobile
Web

Installing

  1. Add dependency to pubspec.yaml

    Get the latest version in the 'Installing' tab on pub.dartlang.org

dependencies:
    horizontal_card_pager: ^1.1.1
  1. Import the package
import 'package:horizontal_card_pager/horizontal_card_pager.dart';
import 'package:horizontal_card_pager/card_item.dart';
  1. Adding HorizontalCardPager

With optional parameters

HorizontalCardPager(
    initialPage : 2 // default value is 2
    onPageChanged: (page) => print("page : $page"),
    onSelectedItem: (page) => print("selected : $page"),
    items: { ... },  // set ImageCardItem or IconTitleCardItem class
))
  1. Put CardItem object in items parameter in HorizontalCardPager

If the contents of the card contain only images, use the ImageCardItem class. and If the contents of the card include an icon and a title, use the IconTitleCardItem class.

Image Icon & Text
imagetype icontitletype
ImageCardItem

class ImageCarditem extends CardItem {
  final Widget image;

  ImageCarditem({this.image});
}
IconTitleCardItem
class IconTitleCardItem extends CardItem {
  final IconData iconData;
  final String text;
  final Color selectedBgColor;
  final Color noSelectedBgColor;
  final Color selectedIconTextColor;
  final Color noSelectedIconTextColor;

  IconTitleCardItem(
      {this.iconData,
      this.text,
      this.selectedIconTextColor = Colors.white,
      this.noSelectedIconTextColor = Colors.grey,
      this.selectedBgColor = Colors.blue,
      this.noSelectedBgColor = Colors.white});
}

How to use

Check out the example app in the example directory or the 'Example' tab on pub.dartlang.org for a more complete example.

Reference

This package's animation is inspired from from this Dribbble art.

TODO

  • [x] Attach Gesture Detector
  • [x] implement call back method
  • [x] Enable to customize card design
    • [x] icon & title
    • [x] image only
  • [x] Implements sample app
  • [x] Publish plugin

所属分类

源码仓库

使用此插件的项目

暂无相关数据。