utd_gift_kit 0.1.0
utd_gift_kit: ^0.1.0 copied to clipboard
In-room virtual gifts for Flutter: a typed gift protocol and a play queue that serialises overlapping gifts. No plugin dependencies. Transport-agnostic — works in an audio room, a live stream, or any [...]
Changelog #
0.1.0 #
First release.
UTDGiftProtocol— typed send/receive over the room's data channel.sendGift(giftId, count, receiverIds, extra)and agiftStreamof decodedUTDGiftEvents, not raw JSON.extrais app-defined and passes through verbatim. A malformed gift from any peer is dropped, never thrown — the same channel carries seat updates and chat. The local sender's own gift is emitted once and the room's echo of it ignored, so it never plays twice.UTDGiftPlayList— plays one gift at a time in arrival order, so two gifts arriving together no longer animate on top of each other. Bounded (maxQueueLength), dropping the oldest pending under a gift storm, and with amaxPlayDurationbackstop so a player that never reports completion — a failed asset, a widget disposed mid-play — cannot wedge the queue and silence gifts for the rest of the session.UTDGiftOverlay— drives the queue and hands each gift to a builder the app supplies.- No animation player and no file cache are shipped, and the package has zero plugin dependencies. Every app already has both; a second copy of either would be dead weight on the user's device.
UTDGiftTransport— the package binds to anything that can send and receive maps, so one implementation serves an audio room, a live stream, or an app's own channel.UTDGiftProtocol.encodeis public so a SERVER can emit the identical message. That is the correct design when money is involved:sendGiftis a display event and is spoofable by construction — the charge belongs on the backend.