mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-22 09:08:45 +00:00
@@ -119,7 +119,6 @@ class _SuperChatCardState extends State<SuperChatCard> {
|
||||
Text(
|
||||
"¥${item.price}",
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Utils.parseColor(item.backgroundPriceColor),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -16,14 +16,17 @@ class SuperChatPanel extends StatefulWidget {
|
||||
State<SuperChatPanel> createState() => _SuperChatPanelState();
|
||||
}
|
||||
|
||||
class _SuperChatPanelState extends DebounceStreamState<SuperChatPanel, bool> {
|
||||
class _SuperChatPanelState extends DebounceStreamState<SuperChatPanel, bool>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
@override
|
||||
Duration get duration => const Duration(milliseconds: 300);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return Obx(
|
||||
() => ListView.separated(
|
||||
key: const PageStorageKey('live-sc'),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
physics: const ClampingScrollPhysics(),
|
||||
itemCount: widget.controller.superChatMsg.length,
|
||||
@@ -42,4 +45,7 @@ class _SuperChatPanelState extends DebounceStreamState<SuperChatPanel, bool> {
|
||||
|
||||
@override
|
||||
void onValueChanged(value) => widget.controller.clearSC();
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
}
|
||||
|
||||
@@ -77,6 +77,11 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
this,
|
||||
ModalRoute.of(context)! as PageRoute,
|
||||
);
|
||||
padding = MediaQuery.viewPaddingOf(context);
|
||||
final size = MediaQuery.sizeOf(context);
|
||||
maxWidth = size.width;
|
||||
maxHeight = size.height;
|
||||
isPortrait = size.isPortrait;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -173,11 +178,6 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
padding = MediaQuery.viewPaddingOf(context);
|
||||
final size = MediaQuery.sizeOf(context);
|
||||
maxWidth = size.width;
|
||||
maxHeight = size.height;
|
||||
isPortrait = size.isPortrait;
|
||||
if (Platform.isAndroid) {
|
||||
return Floating().isPipMode
|
||||
? videoPlayerPanel(
|
||||
@@ -254,7 +254,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
"id": Utils.generateRandomString(8),
|
||||
"price": 66,
|
||||
"end_time":
|
||||
DateTime.now().millisecondsSinceEpoch ~/ 1000 - 5,
|
||||
DateTime.now().millisecondsSinceEpoch ~/ 1000 + 5,
|
||||
"message": Utils.generateRandomString(55),
|
||||
"user_info": {
|
||||
"face": "",
|
||||
@@ -733,11 +733,9 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
_liveRoomController.pageIndex.value = value,
|
||||
children: [
|
||||
KeepAliveWrapper(builder: (context) => chat()),
|
||||
KeepAliveWrapper(
|
||||
builder: (context) => SuperChatPanel(
|
||||
key: scKey,
|
||||
controller: _liveRoomController,
|
||||
),
|
||||
SuperChatPanel(
|
||||
key: scKey,
|
||||
controller: _liveRoomController,
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -35,6 +35,7 @@ class LiveRoomChatPanel extends StatelessWidget {
|
||||
children: [
|
||||
Obx(
|
||||
() => ListView.separated(
|
||||
key: const PageStorageKey('live-chat'),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
controller: liveRoomController.scrollController,
|
||||
separatorBuilder: (context, index) => const SizedBox(height: 8),
|
||||
@@ -89,7 +90,7 @@ class LiveRoomChatPanel extends StatelessWidget {
|
||||
"id": Utils.generateRandomString(8),
|
||||
"price": 66,
|
||||
"end_time":
|
||||
DateTime.now().millisecondsSinceEpoch ~/ 1000 - 5,
|
||||
DateTime.now().millisecondsSinceEpoch ~/ 1000 + 5,
|
||||
"message": "message message message message message",
|
||||
"user_info": {
|
||||
"face": "",
|
||||
@@ -145,7 +146,7 @@ class LiveRoomChatPanel extends StatelessWidget {
|
||||
children: [
|
||||
TextSpan(
|
||||
text:
|
||||
'SC: ${liveRoomController.superChatMsg.length}',
|
||||
'SC(${liveRoomController.superChatMsg.length})',
|
||||
),
|
||||
const WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
|
||||
@@ -63,6 +63,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
} else {
|
||||
_videoReplyController.scrollController.removeListener(listener);
|
||||
}
|
||||
bottom = MediaQuery.viewPaddingOf(context).bottom;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -92,7 +93,6 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
bottom = MediaQuery.viewPaddingOf(context).bottom;
|
||||
final theme = Theme.of(context);
|
||||
return refreshIndicator(
|
||||
onRefresh: _videoReplyController.onRefresh,
|
||||
|
||||
Reference in New Issue
Block a user