Skip to content

Commit 5972213

Browse files
Don't wrap string interpolated objects with braces
Corrects the following issues from the analyzer: * info • Avoid using braces in interpolation when not needed • example/lib/main.dart:41:59 • unnecessary_brace_in_string_interps * info • Avoid using braces in interpolation when not needed • example/lib/main.dart:50:46 • unnecessary_brace_in_string_interps
1 parent 5c0aa88 commit 5972213

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

example/lib/main.dart

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,23 @@ class _MyAppState extends State<MyApp> {
3838

3939
OneSignal.shared
4040
.setNotificationOpenedHandler((OSNotificationOpenedResult result) {
41-
print('NOTIFICATION OPENED HANDLER CALLED WITH: ${result}');
42-
this.setState(() {
43-
_debugLabelString =
44-
"Opened notification: \n${result.notification.jsonRepresentation().replaceAll("\\n", "\n")}";
41+
print('NOTIFICATION OPENED HANDLER CALLED WITH: $result');
42+
this.setState(() {
43+
_debugLabelString =
44+
"Opened notification: \n${result.notification.jsonRepresentation().replaceAll("\\n", "\n")}";
4545
});
4646
});
4747

48-
OneSignal.shared
49-
.setNotificationWillShowInForegroundHandler((OSNotificationReceivedEvent event) {
50-
print('FOREGROUND HANDLER CALLED WITH: ${event}');
51-
/// Display Notification, send null to not display
52-
event.complete(null);
53-
54-
this.setState(() {
55-
_debugLabelString =
56-
"Notification received in foreground notification: \n${event.notification.jsonRepresentation().replaceAll("\\n", "\n")}";
48+
OneSignal.shared.setNotificationWillShowInForegroundHandler(
49+
(OSNotificationReceivedEvent event) {
50+
print('FOREGROUND HANDLER CALLED WITH: $event');
51+
52+
/// Display Notification, send null to not display
53+
event.complete(null);
54+
55+
this.setState(() {
56+
_debugLabelString =
57+
"Notification received in foreground notification: \n${event.notification.jsonRepresentation().replaceAll("\\n", "\n")}";
5758
});
5859
});
5960

0 commit comments

Comments
 (0)