Search categories, packages and repositories

horizontal_card_pager cover
Package detailsv1.1.1

horizontal_card_pager

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

AndroidiOSWebmacOSWindowsLinux
30-day downloads
183
Likes
173
Pub points
140

Install package

flutter pub add horizontal_card_pager

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package for creating dynamic, visually appealing horizontal card pagers. It enables smooth, interactive card transitions in a horizontal layout, ideal for showcasing content like images, cards, or product listings. The pager supports customizable animations and responsive design across multiple platforms. Perfect for apps needing engaging, swipeable card interfaces with modern aesthetics.

Use cases

  • Swipeable product carousels
  • Image galleries
  • Interactive content sliders
  • Onboarding screens
  • Feature highlight sections
  • User profile showcases

Key features

  • Horizontal card navigation
  • Smooth animation transitions
  • Customizable card styling
  • Responsive design support
  • Cross-platform compatibility
  • Dynamic content loading

Suitable for

  • Mobile app developers
  • UI/UX designers
  • E-commerce applications
  • Content-rich apps
  • Interactive prototypes

Considerations

  • Requires careful performance tuning for large datasets
  • May need additional logic for infinite scrolling
  • Limited built-in pagination indicators
  • Best suited for moderate card counts
  • Not optimized for vertical layouts
  • Depends on external dependencies for advanced features

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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

Categories

Source repository

Projects using this package

No data available yet.