title: Flutter: How to insert text in middle of text field text
body: <p>I have a text field in flutter and an emoji picker button. On selecting an emoji I need to insert it at the current cursor position.
  How can I achieve this?
  Currently using <code>TextEditingController</code> I'm only able to append the emoji. I'm not able to get the current cursor offset.</p>
  
  <pre><code>emojiPicker() {
      return EmojiPicker(
        rows: 3,
        columns: 7,
        recommendKeywords: null,
        indicatorColor: flujoAccentColor,
        onEmojiSelected: (emoji, category) {
          print(emoji);
          _messageInputController.text =
              _messageInputController.text + emoji.emoji;
       }
      );
    }
  </code></pre>