Skip to content

Commit 056c847

Browse files
committed
Fix Type Conversion Warning
• Fixes an issue with the SDK that would print a warning for the private _handleMethod() method. • It was returning the results of calling private handler references, which themselves returned void. However the function is defined to return Future<Null> not void, so a warning was printed. • Fixed by returning null at the end. The result of this function is not used and the SDK does not need to wait asynchronously for the handlers to finish executing.
1 parent 2c6fcd2 commit 056c847

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/onesignal.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,23 +266,23 @@ class OneSignal {
266266
Future<Null> _handleMethod(MethodCall call) async {
267267
if (call.method == 'OneSignal#handleReceivedNotification' &&
268268
this._onReceivedNotification != null) {
269-
return this._onReceivedNotification(
269+
this._onReceivedNotification(
270270
OSNotification(call.arguments.cast<String, dynamic>()));
271271
} else if (call.method == 'OneSignal#handleOpenedNotification' &&
272272
this._onOpenedNotification != null) {
273-
return this._onOpenedNotification(
273+
this._onOpenedNotification(
274274
OSNotificationOpenedResult(call.arguments.cast<String, dynamic>()));
275275
} else if (call.method == 'OneSignal#subscriptionChanged' &&
276276
this._onSubscriptionChangedHandler != null) {
277-
return this._onSubscriptionChangedHandler(
277+
this._onSubscriptionChangedHandler(
278278
OSSubscriptionStateChanges(call.arguments.cast<String, dynamic>()));
279279
} else if (call.method == 'OneSignal#permissionChanged' &&
280280
this._onPermissionChangedHandler != null) {
281-
return this._onPermissionChangedHandler(
281+
this._onPermissionChangedHandler(
282282
OSPermissionStateChanges(call.arguments.cast<String, dynamic>()));
283283
} else if (call.method == 'OneSignal#emailSubscriptionChanged' &&
284284
this._onEmailSubscriptionChangedHandler != null) {
285-
return this._onEmailSubscriptionChangedHandler(
285+
this._onEmailSubscriptionChangedHandler(
286286
OSEmailSubscriptionStateChanges(
287287
call.arguments.cast<String, dynamic>()));
288288
}

0 commit comments

Comments
 (0)