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