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