Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit79663b0

Browse files
authored
Remove usage of deprecated Notification.setListener(..) (#8317)
Also: cleanup of nullability parameters in `FlutterMessages.java`
1 parent025ee79 commit79663b0

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

‎flutter-idea/src/io/flutter/FlutterMessages.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
packageio.flutter;
77

88
importcom.intellij.notification.Notification;
9-
importcom.intellij.notification.NotificationListener;
109
importcom.intellij.notification.NotificationType;
1110
importcom.intellij.notification.Notifications;
1211
importcom.intellij.openapi.project.Project;
@@ -23,24 +22,24 @@ public class FlutterMessages {
2322
privateFlutterMessages() {
2423
}
2524

26-
publicstaticvoidshowError(Stringtitle,@NotNullStringmessage,@NullableProjectproject) {
25+
publicstaticvoidshowError(@NotNullStringtitle,@NotNullStringmessage,@NullableProjectproject) {
2726
Notifications.Bus.notify(
2827
newNotification(FLUTTER_NOTIFICATION_GROUP_ID,
2928
title,
3029
message,
3130
NotificationType.ERROR),project);
3231
}
3332

34-
publicstaticvoidshowWarning(Stringtitle,Stringmessage,@NullableProjectproject) {
33+
publicstaticvoidshowWarning(@NotNullStringtitle,@NotNullStringmessage,@NullableProjectproject) {
3534
Notifications.Bus.notify(
3635
newNotification(
3736
FLUTTER_NOTIFICATION_GROUP_ID,
3837
title,
3938
message,
40-
NotificationType.WARNING).setListener(NotificationListener.URL_OPENING_LISTENER),project);
39+
NotificationType.WARNING),project);
4140
}
4241

43-
publicstaticvoidshowInfo(Stringtitle,Stringmessage,@NullableProjectproject) {
42+
publicstaticvoidshowInfo(@NotNullStringtitle,@NotNullStringmessage,@NullableProjectproject) {
4443
finalNotificationnotification =newNotification(
4544
FLUTTER_NOTIFICATION_GROUP_ID,
4645
title,

‎flutter-idea/src/io/flutter/run/daemon/DeviceDaemon.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
importcom.intellij.openapi.ui.Messages;
1919
importcom.intellij.openapi.util.SystemInfo;
2020
importcom.intellij.openapi.util.io.FileUtil;
21+
importcom.intellij.openapi.util.text.StringUtil;
2122
importio.flutter.FlutterMessages;
2223
importio.flutter.FlutterUtils;
2324
importio.flutter.android.IntelliJAndroidSdk;
@@ -361,14 +362,16 @@ public void onDaemonLogMessage(@NotNull DaemonEvent.DaemonLogMessage message) {
361362

362363
@Override
363364
publicvoidonDaemonShowMessage(@NotNullDaemonEvent.DaemonShowMessageevent) {
364-
if ("error".equals(event.level)) {
365-
FlutterMessages.showError(event.title,event.message,null);
366-
}
367-
elseif ("warning".equals(event.level)) {
368-
FlutterMessages.showWarning(event.title,event.message,null);
369-
}
370-
else {
371-
FlutterMessages.showInfo(event.title,event.message,null);
365+
if (StringUtil.isNotEmpty(event.level) &&StringUtil.isNotEmpty(event.title) &&StringUtil.isNotEmpty(event.message)) {
366+
if ("error".equals(event.level)) {
367+
FlutterMessages.showError(event.title,event.message,null);
368+
}
369+
elseif ("warning".equals(event.level)) {
370+
FlutterMessages.showWarning(event.title,event.message,null);
371+
}
372+
else {
373+
FlutterMessages.showInfo(event.title,event.message,null);
374+
}
372375
}
373376
}
374377

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp