From 483e25d8c5d7c736a263b60c5bf03ee7f64a1ef7 Mon Sep 17 00:00:00 2001 From: eliotRosewater Date: Wed, 6 Dec 2023 13:15:30 -0500 Subject: [PATCH] I ran the command "dart format ." --- .../background_android_isolate_platform.dart | 18 ++++++++++++------ .../src/push_notification_events_internal.dart | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/src/platform/src/background_android_isolate_platform.dart b/lib/src/platform/src/background_android_isolate_platform.dart index 66ed831cb..cf743b3b5 100644 --- a/lib/src/platform/src/background_android_isolate_platform.dart +++ b/lib/src/platform/src/background_android_isolate_platform.dart @@ -22,12 +22,14 @@ class BackgroundIsolateAndroidPlatform { case PlatformMethod.pushOnBackgroundMessage: return _onPushBackgroundMessage(call.arguments as RemoteMessage); default: - throw PlatformException(code: 'invalid_method', message: 'No such method ${call.method}'); + throw PlatformException( + code: 'invalid_method', message: 'No such method ${call.method}'); } }); } - static final BackgroundIsolateAndroidPlatform _platform = BackgroundIsolateAndroidPlatform._internal(); + static final BackgroundIsolateAndroidPlatform _platform = + BackgroundIsolateAndroidPlatform._internal(); /// @nodoc /// Singleton instance of BackgroundIsolateAndroidPlatform @@ -37,15 +39,19 @@ class BackgroundIsolateAndroidPlatform { /// A method channel used to communicate with the user's app isolate /// we explicitly launched when a RemoteMessage is received. /// Used only on Android. - final MethodChannel _methodChannel = MethodChannel('io.ably.flutter.plugin.background', StandardMethodCodec(Codec())); + final MethodChannel _methodChannel = MethodChannel( + 'io.ably.flutter.plugin.background', StandardMethodCodec(Codec())); - final PushNotificationEventsInternal _pushNotificationEvents = Push.notificationEvents as PushNotificationEventsInternal; + final PushNotificationEventsInternal _pushNotificationEvents = + Push.notificationEvents as PushNotificationEventsInternal; - Future _onPushBackgroundMessage(RemoteMessage remoteMessage) async => _pushNotificationEvents.handleBackgroundMessage(remoteMessage); + Future _onPushBackgroundMessage(RemoteMessage remoteMessage) async => + _pushNotificationEvents.handleBackgroundMessage(remoteMessage); /// @nodoc /// Equivalent of [Platform.invokePlatformMethod] which cannot be used here /// because we may not be able to acquire [Platform] instance here, so we /// need to use a raw [MethodChannel] communication - Future invokeMethod(String method, [dynamic arguments]) async => _methodChannel.invokeMethod(method, arguments); + Future invokeMethod(String method, [dynamic arguments]) async => + _methodChannel.invokeMethod(method, arguments); } diff --git a/lib/src/platform/src/push_notification_events_internal.dart b/lib/src/platform/src/push_notification_events_internal.dart index c5ec7b187..2c13bcdbb 100644 --- a/lib/src/platform/src/push_notification_events_internal.dart +++ b/lib/src/platform/src/push_notification_events_internal.dart @@ -85,7 +85,7 @@ class PushNotificationEventsInternal implements PushNotificationEvents { if (_onBackgroundMessage != null) { dynamic onBackgroundMessageResult = _onBackgroundMessage!(remoteMessage); // ^^^ _onBackgroundMessage() can return void or Future - if (onBackgroundMessageResult is Future) { + if (onBackgroundMessageResult is Future) { await onBackgroundMessageResult; // if it returns a Future we await on it. } } else {