title: How fix this null check issue?
body: <p>Dart Language:</p>
  <p>This is plugin issue
  xmpp_stone plugin
  I can't fix this issue
  anyone known please replay
  [![enter image description here]
  https://i.stack.imgur.com/FHe0O.png</p>
  <p>Dart Language:</p>
  <p>This is plugin issue
  xmpp_stone plugin
  I can't fix this issue
  anyone known please replay
  [![enter image description here]
  https://i.stack.imgur.com/FHe0O.png</p>
  <p>This is full code issue in xmpp_stone plugin</p>
  <pre><code>import 'dart:io';
  import 'package:xmpp_stone/src/logger/Log.dart';
  import 'package:console/console.dart';
  import 'dart:async';
  import 'dart:convert';
  import 'package:xmpp_stone/xmpp_stone.dart' as xmpp;
  import 'package:image/image.dart' as image;
  final String TAG = 'example';
  
  class ExampleConnectionStateChangedListener implements xmpp.ConnectionStateChangedListener {
    late xmpp.Connection _connection;
    late xmpp.MessagesListener _messagesListener;
  
    StreamSubscription&lt;String&gt;? subscription;
  
    ExampleConnectionStateChangedListener(xmpp.Connection connection, xmpp.MessagesListener messagesListener) {
      _connection = connection;
      _messagesListener = messagesListener;
      _connection.connectionStateStream.listen(onConnectionStateChanged);
    }
  
    @override
    void onConnectionStateChanged(xmpp.XmppConnectionState state) {
      if (state == xmpp.XmppConnectionState.Ready) {
        Log.d(TAG, 'Connected');
       _connection.getMamModule().queryAll();
        var vCardManager = xmpp.VCardManager(_connection);
        vCardManager.getSelfVCard().then((vCard) {
          if (vCard != null) {
            Log.d(TAG, 'Your info' + vCard.buildXmlString());
          }
        });
        var messageHandler = xmpp.MessageHandler.getInstance(_connection);
        var rosterManager = xmpp.RosterManager.getInstance(_connection);
        messageHandler.messagesStream.listen(_messagesListener.onNewMessage);
        sleep(const Duration(seconds: 1));
        var receiver = 'yyy@gmail.com';
        var receiverJid = xmpp.Jid.fromFullJid(receiver);
        rosterManager.addRosterItem(xmpp.Buddy(receiverJid)).then((result) {
          if (result.description != null) {
            print(&quot;TAG, 'add roster'&quot; + result.description!);
          }
        });
        sleep(const Duration(seconds: 1));
        vCardManager.getVCardFor(receiverJid).then((vCard) {
          if (vCard != null) {
            print(&quot;TAG, 'Receiver info'&quot; + vCard.buildXmlString());
            if (vCard != null &amp;&amp; vCard.image != null) {
              var file = File('test456789.jpg')..writeAsBytesSync(image.encodeJpg(vCard.image!));
              print(&quot;TAG, IMAGE SAVED TO: ${file.path}&quot;);
            }
          }
        });
        var presenceManager = xmpp.PresenceManager.getInstance(_connection);
        presenceManager.presenceStream.listen(onPresence);
  
      }
    }
  
    void onPresence(xmpp.PresenceData event) {
      Log.d(TAG, 'presence Event from ' + event.jid!.fullJid! + ' PRESENCE: ' + event.showElement.toString());
    }
  }
  
  Stream&lt;String&gt; getConsoleStream() {
    return Console.adapter.byteStream().map((bytes) {
      var str = ascii.decode(bytes);
      str = str.substring(0, str.length - 1);
      return str;
    });
  }
  
  class ExampleMessagesListener implements xmpp.MessagesListener {
  
    @override
    void onNewMessage(xmpp.MessageStanza? message) {
      if (message!.body != null) {
        Log.d(TAG ,format(
            'New Message from {color.blue}${message.fromJid!.userAtDomain}{color.end} message: {color.red}${message.body}{color.end}'));
      }
    }
  
    @override
    void onChatMessage(xmpp.MessageStanza? message) {
      print(message);
      if (message!.body != null) {
        Log.d(TAG,format(
            'New Message from {color.blue}${message.fromJid!.userAtDomain}{color.end} message: {color.red}${message.body}{color.end}'));
      }
    }
  }
  
  sendmessageforxmpp(){
    var userAtDomain = 'xxx@gmail.com';
  
    var password = 'password';
    var jid = xmpp.Jid.fromFullJid(userAtDomain);
    var account = xmpp.XmppAccountSettings(userAtDomain, jid.local, 
   jid.domain, password, 5222, resource: 'xmppstone');
    var connection = xmpp.Connection(account);
    var receiver = 'yyy@gmail.com';
    var receiverJid = xmpp.Jid.fromFullJid(receiver);
  Log.d(TAG, receiverJid.fullJid.toString());
    var messageHandler = 
     xmpp.MessageHandler.getInstance(connection); 
      messageHandler.sendMessage(receiverJid, &quot;str&quot;);
  }
  </code></pre>