mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: emote panel
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -117,18 +117,17 @@ class _EmotePanelState extends State<EmotePanel>
|
||||
SizedBox(height: MediaQuery.of(context).padding.bottom),
|
||||
],
|
||||
)
|
||||
: _errorWidget,
|
||||
Error() => _errorWidget,
|
||||
: _errorWidget(),
|
||||
Error() => _errorWidget(loadingState.errMsg),
|
||||
LoadingState() => throw UnimplementedError(),
|
||||
};
|
||||
}
|
||||
|
||||
Widget get _errorWidget => Center(
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
_emotePanelController.onReload();
|
||||
},
|
||||
Widget _errorWidget([String? errMsg]) => Center(
|
||||
child: TextButton.icon(
|
||||
onPressed: _emotePanelController.onReload,
|
||||
icon: Icon(Icons.refresh),
|
||||
label: Text(errMsg ?? '没有数据'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -131,18 +131,17 @@ class _LiveEmotePanelState extends State<LiveEmotePanel>
|
||||
SizedBox(height: MediaQuery.of(context).padding.bottom),
|
||||
],
|
||||
)
|
||||
: _errorWidget,
|
||||
Error() => _errorWidget,
|
||||
: _errorWidget(),
|
||||
Error() => _errorWidget(loadingState.errMsg),
|
||||
LoadingState() => throw UnimplementedError(),
|
||||
};
|
||||
}
|
||||
|
||||
Widget get _errorWidget => Center(
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
_emotePanelController.onReload();
|
||||
},
|
||||
Widget _errorWidget([String? errMsg]) => Center(
|
||||
child: TextButton.icon(
|
||||
onPressed: _emotePanelController.onReload,
|
||||
icon: Icon(Icons.refresh),
|
||||
label: Text(errMsg ?? '没有数据'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -220,10 +220,6 @@ class _ReplyPageState extends CommonPublishPageState<LiveSendDmPanel> {
|
||||
emoticonOptions,
|
||||
emoticonUnique,
|
||||
}) async {
|
||||
if (!liveRoomController.isLogin) {
|
||||
SmartDialog.showToast('未登录');
|
||||
return;
|
||||
}
|
||||
final res = await LiveHttp.sendLiveMsg(
|
||||
roomId: liveRoomController.roomId,
|
||||
msg: message,
|
||||
|
||||
@@ -13,6 +13,7 @@ import 'package:canvas_danmaku/canvas_danmaku.dart';
|
||||
import 'package:floating/floating.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/common/widgets/network_img_layer.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/index.dart';
|
||||
@@ -552,6 +553,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: onSendDanmaku,
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Text(
|
||||
'发送弹幕',
|
||||
style: TextStyle(color: _color),
|
||||
@@ -569,6 +571,10 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
);
|
||||
|
||||
void onSendDanmaku([bool fromEmote = false]) {
|
||||
if (!_liveRoomController.isLogin) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
Get.generalDialog(
|
||||
barrierLabel: '',
|
||||
barrierDismissible: true,
|
||||
|
||||
Reference in New Issue
Block a user