Component Name | Class Name | Description |
Gift Selection Panel | GiftSendWidget | Displays the gift list panel when clicked, allowing users to select and send gifts. |
Gift Playback Component | GiftPlayWidget | Receives gift messages and renders the corresponding animation effects (such as SVGA animations) on screen. |
Gift Panel | Live Comment Gifts | Full-Screen Gifts |
![]() | ![]() | ![]() |
GiftSendWidget provides an icon button that, when clicked, opens the gift list panel for selection and sending.import 'package:flutter/material.dart';import 'package:live_uikit_gift/live_uikit_gift.dart';class YourAnchorPage extends StatefulWidget {final String liveId;const YourAnchorPage({super.key, required this.liveId});@overrideState<YourAnchorPage> createState() => _YourAnchorPageState();}class _YourAnchorPageState extends State<YourAnchorPage> {// 1. Create GiftListController: pass the live room ID as roomIdlate final GiftListController _giftListController = GiftListController(roomId: widget.liveId,language: 'zh', // Gift name language: 'zh' / 'en', etc.);@overridevoid initState() {super.initState();// 2. Listen for gift send success callback (optional)_giftListController.onSendGiftCallback = (gift, count) {debugPrint('Sent gift: ${gift.name} x$count');};}@overrideWidget build(BuildContext context) {return Scaffold(body: SafeArea(child: Stack(children: [// ... Other live room elements ...// 3. Integrate GiftSendWidget: clicking the icon will pop up the gift panelPositioned(bottom: 12,right: 16,child: GiftSendWidget(controller: _giftListController,),),],),),);}}
GiftPlayWidget is a transparent overlay for gift animations, typically placed above the video area and below the interactive controls.import 'package:flutter/material.dart';import 'package:live_uikit_gift/live_uikit_gift.dart';import 'package:tencent_live_uikit/common/index.dart';class YourAnchorPage extends StatefulWidget {final String liveId;const YourAnchorPage({super.key, required this.liveId});@overrideState<YourAnchorPage> createState() => _YourAnchorPageState();}class _YourAnchorPageState extends State<YourAnchorPage> {// 1. Create GiftPlayController: pass the live room ID as roomIdlate final GiftPlayController _giftPlayController = GiftPlayController(roomId: widget.liveId,language: 'zh', // Gift name language: 'zh' / 'en', etc.);@overrideWidget build(BuildContext context) {return Scaffold(body: SafeArea(child: Stack(children: [// ... Other live room elements ...// 2. Integrate GiftPlayWidgetPositioned(width: 1.screenWidth,height: 1.screenHeight,child: GiftPlayWidget(giftPlayController: _giftPlayController,),),],),),);}}
フィードバック