提交 b95a646f authored 作者: 史晓晨's avatar 史晓晨

feat:注入controller

上级 116fc181
......@@ -29,6 +29,7 @@ MessageConfig messageConfig = MessageConfig();
abstract class BaseMessageConfig
with NotificationManager, NoticeManager, MessageNet {
//处理消息页面跳转
Future? onJumpToMessagePage(String page, dynamic arguments);
......@@ -125,8 +126,8 @@ abstract class BaseMessageConfig
// 构造方法
BaseMessageConfig() {
notificationLayoutController = Get.put(NotificationLayoutController());
noticeDialogWidgetController = Get.put(NoticeDialogWidgetController());
// notificationLayoutController = Get.put(NotificationLayoutController());
// noticeDialogWidgetController = Get.put(NoticeDialogWidgetController());
print("=====11111 BaseMessageConfig notificationLayoutController ${Get.find<NotificationLayoutController>()} $notificationLayoutController");
print("=====11111 BaseMessageConfig noticeDialogWidgetController ${Get.find<NoticeDialogWidgetController>()} $noticeDialogWidgetController");
}
......
import 'package:clx_flutter_message/core/notice/notice_dialog_widget.dart';
import 'package:get/get.dart';
import '../model/message_data.dart';
mixin NoticeManager {
NoticeDialogWidgetController? noticeDialogWidgetController;
NoticeDialogWidgetController? noticeDialogWidgetController = Get.put(NoticeDialogWidgetController());
void insertNotice(MessageData data) {
noticeDialogWidgetController?.insertNotice(data);
......
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import '../model/message_data.dart';
import 'notification_layout/notification_layout_widget.dart';
......@@ -7,7 +8,7 @@ import 'notification_layout/notification_layout_widget.dart';
mixin NotificationManager {
OverlayEntry? _overlayEntry;
NotificationLayoutController? notificationLayoutController;
NotificationLayoutController? notificationLayoutController = Get.put(NotificationLayoutController());
/// 显示悬浮布局
void showNotification(BuildContext? context) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论