title: How to send push Notification using FCM and Flutter(One to Another Device)?
body: <p>I have devloped One to one chat system in flutter and want to send push notification to another device using FCM.</p>
  
  <p>I have setup all the flutter and firebase messaging requirement.</p>
  
  <pre><code>//In InitState()
  _firebaseMessaging.onTokenRefresh.listen(sendTokenToServer);
      _firebaseMessaging.getToken();
      _firebaseMessaging.configure(onLaunch: (Map&lt;String, dynamic&gt; msg) {
        print("onLaunch");
        Navigator.push(
          context,
          MaterialPageRoute(builder: (context) =&gt; Message(this.user, this.event)),
        );
      }, onResume: (Map&lt;String, dynamic&gt; msg) {
        print("onResume");
        Navigator.push(
          context,
          MaterialPageRoute(builder: (context) =&gt; Message(this.user, this.event)),
        );
      }, onMessage: (Map&lt;String, dynamic&gt; msg) {
        print("onMessage");
      });
      _firebaseMessaging.requestNotificationPermissions(
          const IosNotificationSettings(sound: true, alert: true, badge: true));
      _firebaseMessaging.onIosSettingsRegistered
          .listen((IosNotificationSettings setting) {
        print("IOS");
      });
  
  //sendTokenToServer() - function send FCM token my Postgres DB
  
  //When user clicks on send Button
  
  Future sendNotification(userData, eventData) async {
      await Messaging.sendToAll(
        title:
            "${toBeginningOfSentenceCase(userData['User']['name'])} on ${toBeginningOfSentenceCase(eventData['Event']['eventName'])} event",
        body: _messageController.text,
        fcmToken: fcmTokenToServer,
      );
    }
  
  //Messaging.sendToAll()
  static Future&lt;Response&gt; sendToAll(
            {@required String title,
            @required String body,
            @required String fcmToken}) =&gt;
        sendTo(title: title, body: body, fcmToken: fcmToken);
  
    static Future&lt;Response&gt; sendTo({
      @required String title,
      @required String body,
      @required String fcmToken,
    }) =&gt;
        client.post(
          'https://fcm.googleapis.com/fcm/send',
          body: json.encode({
            'notification': {'body': '$body', 'title': '$title'},
            'priority': 'high',
            'data': {
              'click_action': 'FLUTTER_NOTIFICATION_CLICK',
              'id': '1',
              'status': 'done',
            },
            'to': '$fcmToken',
          }),
          headers: {
            'Content-Type': 'application/json',
            'Authorization': 'key=$serverKey',
          },
        );
  </code></pre>
  
  <p>But No push notification is receiving. Is it that I have to implement cloud functions to send notification??</p>