r/FlutterDev • • Jan 07 '21

Plugin We made a package for rendering playing cards

Hey all, we put together a package called playing_cards that allows you to easily render nice looking cards! Hopefully you guys find this useful and let us know if you have any questions/comments. We also put together a short video describing the main features.

If you use it, I'd love to see what you come up with. Feel free to message me or send me screenshots or something!

pub link: https://pub.dev/packages/playing_cards
github: https://github.com/bedardjo/playing_cards
video: https://youtu.be/f9tOu972nhI

130 Upvotes

20 comments sorted by

10

u/Skyost Jan 07 '21 edited Mar 03 '21

Looks great, but why did you have included `ios`, `android` and `web` folders if you're not using any native code ?

8

u/thkp_jon Jan 07 '21

Great point! I can probably get rid of those in the next version. Thanks!

4

u/InFrontOfU Jan 08 '21

i can hear the onslaught of new poker games. Zynga watch your back

1

u/thkp_jon Jan 08 '21

Haha, that would be awesome. I used to play Euchre growing up, so I'd love to see some new, beautiful Euchre games!

2

u/00mario00 Jan 08 '21

Good job! Next, you should make widget for chips with customizable faces, colors and values, and stacks of chips 😁

3

u/thkp_jon Jan 08 '21

Awesome idea. I just watched this poker chip blender tutorial the other day (https://www.youtube.com/watch?v=BZcKSmZspYU) so maybe I could render my own chips!

1

u/00mario00 Jan 08 '21

anyways.. awesome job on the package! :)

2

u/xvadim Jan 08 '21

Oh, it's super.

I started to thought about new flutter game with cards several days ago :)

Your package will be very useful for me.

What about jokers cards?

2

u/thkp_jon Jan 08 '21

Thanks! I will do jokers in a future release (coming soon). I avoided it for now mainly because of simplicity and I just wanted to get something solid out the door. But I've already started looking into jokers. I'm thinking I'll just have a "no_suit" suit and "joker_1" and "joker_2" values. That way, you can customize them individually and there won't be weird issues with jokers having suits. Anyway, that might be tmi.

1

u/xvadim Jan 08 '21

Super!

2

u/Ullebe1 Jan 08 '21

Looks great, good job! Would it be possible to have more than the standard 4 suits of cards?

1

u/thkp_jon Jan 08 '21

Yeah, I definitely considered this. I'm thinking the way you'd accomplish this is have your own model for cards (which might be a good idea anyway, as I tried to be as unopinionated as possible for the model in this lib), and some mapping between your model and this lib's model/style. So you could map YourSuit.treasure_chests->Suit.diamonds but have some styling where the diamonds are rendered as treasure_chests, then you could map YourSuit.coins->Suit.diamonds, but have a different style where it's rendered as coins. I did this a bit while I was developing this lib and experimenting with various things people might want to try, and it was actually fairly clean.

7

u/[deleted] Jan 07 '21

Clever! I really like the idea. I don't have any immediate use for it, but I'm glad to keep it in mind for later. Cheers!

3

u/null-byter Jan 07 '21

Beautiful, good job 👏🏼

2

u/Ohigetjokes Jan 07 '21

Very nice!

2

u/robschmidt87 Jan 07 '21

Looks good. Good job!

2

u/GroovinChip Jan 07 '21

Very nice!

2

u/Kadarach Jan 07 '21

Really cool package !

1

u/Darkglow666 Jan 08 '21

Very nice! Would love to see you add support for fully custom cards and decks, for use with other games that use cards. I realize you can alter the center images on the playing cards right now, but support for entirely different kinds of cards would expand the usefulness of the package immeasurably. The package is great already, though! Thanks for sharing.