title: How to wait for a SmsQuery from a phone number before action
body: <p>I'm trying to trigger an action after receiving a text message, without success.  I can launch my action when an SMS is sent and even delivered, but not when receiving one. I'm using sms 0.1.0 <a href="https://pub.dartlang.org/packages/sms#-readme-tab-" rel="nofollow noreferrer">https://pub.dartlang.org/packages/sms#-readme-tab-</a></p>
  
  <p>to be clear</p>
  
  <p>1  - I can send an sms to another device</p>
  
  <p>2  - the other device receives the sms</p>
  
  <p>3  - the other device then sends me an sms</p>
  
  <p>4 -  I'd like to trigger an action on receipt of this reply</p>
  
  <p>Currently, I can't find how to do that</p>
  
  <p>here is the current code</p>
  
  <p>...</p>
  
  <pre><code> SmsSender sender = new SmsSender();
   String _nirbinumber;
   SmsReceiver receiver = new SmsReceiver();
   SmsMessage _lastMessage = new SmsMessage(null, "No new messages");
  </code></pre>
  
  <p>...</p>
  
  <pre><code>  @override
    Widget build(BuildContext context) {
      return new MaterialApp(
        home: new Scaffold(
          body: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: &lt;Widget&gt;[
              new Container(
                  height: 250.0,
                  child: new Stack(
                    children: &lt;Widget&gt;[
                      new Center(
                        child :
                         new Container(
                          child : new FloatingActionButton(
                              child : new Icon (Icons.location_on),
  
                              onPressed: ()
                              async {
  
                                 SmsMessage message = new SmsMessage(_nirbinumber, '$loc1');    
                                 sender.sendSms(message);
                                 message.addStateListener((state) {
                                 if (state == SmsMessageState.Delivered) {
                                   receiver.onSmsReceived.listen((SmsMessage msg) =&gt; _lastMessage = msg);
  
                                    setState(() {
                                      savegeoValue();    // function to extract GPS coordinate of the received sms and save it with "shared preference" 
                                      StreamSubscription&lt;SmsMessage&gt; _smsSubscription;
                                      }
                                    );
                                    showMap();   // function to launch googlemap view
                                   }
                                  }
                                );
                              }
                          ),
                        ),
                      ),
                    ],
                  )
              )
            ],
          )
      )
  );
  </code></pre>
  
  <p>}</p>