패키지, 저장소 및 앱 카테고리 검색

playing_cards 표지
패키지 상세v0.4.1+11

playing_cards

Flutter 앱에서 표준 52장 카드 덱을 렌더링하기 위한 렌더링 라이브러리입니다. 별다른 번거로움 없이 멋진 플레이 카드를 원하신다면 이 패키지를 사용하세요.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
3
좋아요
145
Pub 점수
150

패키지 설치

flutter pub add playing_cards

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Flutter 패키지로 애플리케이션 내에서 시각적으로 매력적인 표준 52장 카드 덱을 간편하게 렌더링할 수 있습니다. 게임 개발자를 위한 설계로, 적절한 스타일과 레이아웃을 갖춘 즉시 사용 가능한 카드 위젯을 제공하여 복잡한 커스텀 코딩 없이도 카드 기반 UI를 빠르게 통합할 수 있게 해줍니다. 이 라이브러리는 여러 플랫폼을 지원하며 장치 간 일관되고 고품질의 카드 시각 효과를 보장합니다.

사용 사례

  • 카드 게임 개발
  • 인터랙티브 덱 시뮬레이션
  • 카드가 있는 교육 앱
  • 디지털 포커 또는 솔리테어 앱
  • 카드를 사용한 UI 프로토타이핑

주요 기능

  • 사전 빌드된 카드 위젯
  • 크로스 플랫폼 지원
  • 고해상도 카드 디자인
  • Flutter와의 간편한 통합
  • 사용자 지정 가능한 카드 레이아웃

적합한 대상

  • 게임 개발자
  • UI 디자이너
  • 교육 앱 제작자
  • 프로토타이핑 팀

고려 사항

  • 표준 52장 카드 덱에 한정
  • 내장된 게임 로직 없음
  • 카드 상호작용을 수동으로 처리해야 합니다
  • 대규모 카드 컬렉션에 최적화되지 않음

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

playing_cards

The playing_cards package for Flutter allows you to easily render playing cards from a standard 52 card deck. Good defaults are provided out of box, but full customization is possible if a style object is provided.

Getting Started

Here's a quick video overview if you don't like reading :-) https://www.youtube.com/watch?v=f9tOu972nhI

To import:

import 'package:playing_cards/playing_cards.dart';

And here is a simple usage to render a nine of clubs:

PlayingCardView(card: PlayingCard(Suit.clubs, CardValue.nine))

Here is an example of a fully styled deck:

// This style object overrides the styles for spades.
PlayingCardViewStyle myCardStyles = PlayingCardViewStyle(suitStyles: {
  Suit.spades: SuitStyle(
    builder: (context) => FittedBox(
          fit: BoxFit.fitHeight,
          child: Text(
            "💩",
            style: TextStyle(fontSize: 500),
          ),
        ),
    style: TextStyle(color: Colors.brown),
    cardContentBuilders: {
      CardValue.jack: (context) =>
          Image.asset("assets/jack_of_spades.png"),
      CardValue.queen: (context) =>
          Image.asset("assets/queen_of_spades.png"),
      CardValue.king: (context) =>
          Image.asset("assets/king_of_spades.png"),
    })
});
List<PlayingCard> deck = standardFiftyTwoCardDeck();
Container(
  height: 150,
  child: SingleChildScrollView(
    scrollDirection: Axis.horizontal,
    child: Row(
      children: deck.map((e) => PlayingCardView(card: e, style: myCardStyles)).toList(),
    ),
  ),
),

PlayingCardViewStyle also accepts a suitBesideLabel: true option to render the suit next to the rank, instead of below:

A flat fan widget is also provided for the common use cases of fanning cards out horizontally:

ShapeBorder shape = RoundedRectangleBorder(
  borderRadius: BorderRadius.circular(8),
  side: BorderSide(color: Colors.black, width: 1));
FlatCardFan(children: [
  PlayingCardView(
    card: PlayingCard(Suit.hearts, CardValue.ace),
    showBack: true,
    elevation: 3.0,
    shape: shape),
  PlayingCardView(
      card: PlayingCard(Suit.hearts, CardValue.ace),
      showBack: true,
      elevation: 3.0,
      shape: shape),
  PlayingCardView(
      card: PlayingCard(Suit.hearts, CardValue.ace),
      showBack: true,
      elevation: 3.0,
      shape: shape),
  PlayingCardView(
      card: PlayingCard(Suit.hearts, CardValue.ace),
      elevation: 3.0,
      shape: shape)
])

Jokers

Jokers are modelled as two joker CardValues (joker_1, joker_2) in a single joker Suit.

You can use the standardFiftyFourCardDeck() function in deck.dart to create a deck with two Jokers.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.