消息全部已读
This commit is contained in:
@@ -2,6 +2,7 @@ import 'dart:convert';
|
||||
|
||||
import 'package:EasyDartModule/EasyDartModule.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||
@@ -9,6 +10,7 @@ import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
|
||||
part 'message_controller.g.dart'; // 由json_serializable自动生成的部分
|
||||
@@ -211,7 +213,7 @@ class MhMessageController extends GetControllerEx<MhMessageModel> {
|
||||
|
||||
// / 更新消息为已读状态
|
||||
// / 如果传入 [mid],则更新指定消息;如果传入 [all] 为 true,则更新该类型的所有消息
|
||||
Future<void> updateMessageReadStatus(String messageType,
|
||||
Future<void> updateMessageReadStatus(BuildContext context, String messageType,
|
||||
{String? mid, bool all = false}) async {
|
||||
final serviceAddress = ServiceConstant.service_address;
|
||||
final serviceName = ServiceConstant.server_service;
|
||||
@@ -233,10 +235,14 @@ class MhMessageController extends GetControllerEx<MhMessageModel> {
|
||||
onSuccess: (res) {
|
||||
if (res.code == HttpStatusCodes.ok) {
|
||||
getMessageList(messageType);
|
||||
getMessageStatus();
|
||||
}
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: Color(0XFF00C1AA));
|
||||
},
|
||||
onFailure: (res) {
|
||||
print('失败');
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: Color(0xFFFF7159));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user