title: After updating to dart2 i'm having issues with fcm configure and ios notifications
body: <p>I am using Firebase for sending push notification to my app and want to save some values to sharedpreferences. It was working perfectly before the update but it is now giving me errors. My code looks like this:</p>
  <pre><code>static void fcmConfigure(
    BuildContext context, FirebaseMessaging _fcm, String loginUserId) {
  // final FirebaseMessaging _fcm = FirebaseMessaging();
  if (Platform.isIOS) {
    _fcm.requestNotificationPermissions(const IosNotificationSettings());
  }
  
  _fcm.configure(
    onMessage: (Map&lt;String, dynamic&gt; message) async {
      print('onMessage: $message');
  
      final String notiMessage = _parseNotiMessage(message);
  
      Utils.takeDataFromNoti(context, message, loginUserId);
  
      PsSharedPreferences.instance.replaceNotiMessage(
        notiMessage,
      );
    },
    onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
    onLaunch: (Map&lt;String, dynamic&gt; message) async {
      print('onLaunch: $message');
  
      final String notiMessage = _parseNotiMessage(message);
  
      Utils.takeDataFromNoti(context, message, loginUserId);
  
      PsSharedPreferences.instance.replaceNotiMessage(
        notiMessage,
      );
    },
    onResume: (Map&lt;String, dynamic&gt; message) async {
      print('onResume: $message');
  
      final String notiMessage = _parseNotiMessage(message);
  
      Utils.takeDataFromNoti(context, message, loginUserId);
  
      PsSharedPreferences.instance.replaceNotiMessage(
        notiMessage,
      );
    },
  );
  </code></pre>
  <p>}</p>