feat: send live emote

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-13 13:46:11 +08:00
parent 634bae915a
commit 671b6e1ef7
21 changed files with 908 additions and 526 deletions

View File

@@ -19,9 +19,6 @@ class SendDanmakuPanel extends CommonPublishPage {
final dynamic bvid;
final dynamic progress;
// live
final dynamic roomId;
final ValueChanged<DanmakuContentItem> callback;
final bool darkVideoPage;
@@ -36,7 +33,6 @@ class SendDanmakuPanel extends CommonPublishPage {
this.cid,
this.bvid,
this.progress,
this.roomId,
required this.callback,
required this.darkVideoPage,
this.dmConfig,
@@ -86,18 +82,18 @@ class _SendDanmakuPanelState extends CommonPublishPageState<SendDanmakuPanel> {
get _buildColorPanel => Expanded(
child: Obx(
() => LayoutBuilder(
() => Builder(
key: ValueKey(_color.value),
builder: (context, constraints) {
final int crossAxisCount = (constraints.maxWidth / 40).toInt();
builder: (context) {
final bool isCustomColor = _colorList.contains(_color.value).not;
final int length =
_colorList.length + (isCustomColor ? 1 : 0) + 1;
return GridView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: crossAxisCount,
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 40,
mainAxisExtent: 40,
crossAxisSpacing: 4,
mainAxisSpacing: 4,
),
@@ -341,28 +337,27 @@ class _SendDanmakuPanelState extends CommonPublishPageState<SendDanmakuPanel> {
),
child: Row(
children: [
if (widget.roomId == null)
Obx(
() => iconButton(
context: context,
tooltip: '弹幕样式',
onPressed: () {
if (selectKeyboard.value) {
selectKeyboard.value = false;
updatePanelType(PanelType.emoji);
} else {
selectKeyboard.value = true;
updatePanelType(PanelType.keyboard);
}
},
bgColor: Colors.transparent,
iconSize: 24,
icon: Icons.text_format,
iconColor: selectKeyboard.value.not
? themeData.colorScheme.primary
: themeData.colorScheme.onSurfaceVariant,
),
Obx(
() => iconButton(
context: context,
tooltip: '弹幕样式',
onPressed: () {
if (selectKeyboard.value) {
selectKeyboard.value = false;
updatePanelType(PanelType.emoji);
} else {
selectKeyboard.value = true;
updatePanelType(PanelType.keyboard);
}
},
bgColor: Colors.transparent,
iconSize: 24,
icon: Icons.text_format,
iconColor: selectKeyboard.value.not
? themeData.colorScheme.primary
: themeData.colorScheme.onSurfaceVariant,
),
),
const SizedBox(width: 12),
Expanded(
child: Form(
@@ -470,20 +465,15 @@ class _SendDanmakuPanelState extends CommonPublishPageState<SendDanmakuPanel> {
@override
Future onCustomPublish({required String message, List? pictures}) async {
SmartDialog.showLoading(msg: '发送中...');
final res = widget.roomId != null
? await LiveHttp.sendLiveMsg(
roomId: widget.roomId,
msg: editController.text,
)
: await DanmakuHttp.shootDanmaku(
oid: widget.cid,
bvid: widget.bvid,
progress: widget.progress,
msg: editController.text,
mode: _mode.value,
fontsize: _fontsize.value,
color: _color.value.value & 0xFFFFFF,
);
final res = await DanmakuHttp.shootDanmaku(
oid: widget.cid,
bvid: widget.bvid,
progress: widget.progress,
msg: editController.text,
mode: _mode.value,
fontsize: _fontsize.value,
color: _color.value.value & 0xFFFFFF,
);
SmartDialog.dismiss();
if (res['status']) {
Get.back();