更改分享和解绑消息弹窗
This commit is contained in:
@@ -30,7 +30,7 @@ class _MessagePageState extends State<MessagePage> {
|
||||
_pageController =
|
||||
PageController(initialPage: messageController.model.type == 1 ? 0 : 1);
|
||||
messageController.getMessageStatus();
|
||||
_fetchMessageData();
|
||||
// _fetchMessageData();
|
||||
}
|
||||
|
||||
void _fetchMessageData() {
|
||||
@@ -272,13 +272,13 @@ class _MessagePageState extends State<MessagePage> {
|
||||
final list = messageController.messageList.value;
|
||||
return list.isEmpty
|
||||
? const NullDataWidget()
|
||||
: _buildMessageListView(list);
|
||||
: _buildMessageListView(list, "app_vsm");
|
||||
}),
|
||||
Obx(() {
|
||||
final list = messageController.messageList.value;
|
||||
return list.isEmpty
|
||||
? const NullDataWidget()
|
||||
: _buildMessageListView(list);
|
||||
: _buildMessageListView(list, "app_system");
|
||||
}),
|
||||
],
|
||||
),
|
||||
@@ -289,21 +289,42 @@ class _MessagePageState extends State<MessagePage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMessageListView(List dataList) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.rpx),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 30.rpx),
|
||||
...dataList
|
||||
.map((item) => MessageWidgetWidget(data: item))
|
||||
.toList()
|
||||
.divide(SizedBox(height: 30.rpx)),
|
||||
SizedBox(height: 30.rpx),
|
||||
],
|
||||
),
|
||||
// Widget _buildMessageListView(List dataList) {
|
||||
// return Container(
|
||||
// width: double.infinity,
|
||||
// padding: EdgeInsets.symmetric(horizontal: 30.rpx),
|
||||
// child: SingleChildScrollView(
|
||||
// child: Column(
|
||||
// children: [
|
||||
// SizedBox(height: 30.rpx),
|
||||
// ...dataList
|
||||
// .map((item) => MessageWidgetWidget(data: item))
|
||||
// .toList()
|
||||
// .divide(SizedBox(height: 30.rpx)),
|
||||
// SizedBox(height: 30.rpx),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
Widget _buildMessageListView(List dataList, String type) {
|
||||
return NotificationListener<ScrollNotification>(
|
||||
onNotification: (scrollInfo) {
|
||||
if (scrollInfo.metrics.pixels == scrollInfo.metrics.maxScrollExtent) {
|
||||
// 滑到底部,加载下一页
|
||||
messageController.loadMore(type);
|
||||
}
|
||||
return true;
|
||||
},
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.rpx, vertical: 30.rpx),
|
||||
itemCount: dataList.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 30.rpx),
|
||||
child: MessageWidgetWidget(data: dataList[index]),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user