FLUTTER ECOSYSTEM

Origogi/Horizontal_Card_Pager

동적이고 아름다운 카드 뷰 페이지러(수평 방향)를 사용하여 훌륭한 앱을 만들 수 있습니다.

수평 카드 페이지러 프로젝트 이미지
Stars
35
Forks
15
최근 푸시(UTC)
2022. 7. 13.
프로젝트 상태
활성
Jeongtae Kim & Origogi GitHub avatar
GITHUB User

Jeongtae Kim & Origogi ↗

Flutter, Andorid Software Engineer

@kakao
언어DartRubyHTMLKotlinSwiftObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기
https://user-images.githubusercontent.com/35194820/91010815-29a04c80-e61e-11ea-8cb3-52c68d7b8810.png

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

Preview

Mobile
https://user-images.githubusercontent.com/35194820/90704450-73f69600-e2cb-11ea-85bc-e3e6b702e30f.gif https://user-images.githubusercontent.com/35194820/90978412-c4e6e280-e588-11ea-9e5e-6b1f38fc6c30.gif https://user-images.githubusercontent.com/35194820/91016063-21004400-e627-11ea-8899-06f991c8e58c.gif
https://user-images.githubusercontent.com/35194820/91016317-90763380-e627-11ea-85d9-926674648ea4.gif
Web
https://user-images.githubusercontent.com/35194820/94567342-55aa8f80-02a6-11eb-9433-d010792e57b1.png

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