title: How to handle external barcode scanner enter suffix added to scanned string in Flutter
body: <p>I'm new to Flutter and I'm stuck trying to handle the scan in an Android smartphone that has a <strong>physical</strong> barcode scanner in it. 
  It scans a barcode and returns a string like "S3XAHKBC" but with a suffix "\n".</p>
  
  <p>So I'm <strong>not</strong> talking about a software camera driven barcode reader.</p>
  
  <p>In an Android application written in Java I would do something like:</p>
  
  <pre class="lang-java prettyprint-override"><code>myEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
      if ((event != null &amp;&amp; (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_NEXT)) {
        submit();
      }
      return false;
    }
  });
  </code></pre>
  
  <p>In Flutter I've tried everything I found in the documentation and this is what I'd like to get working:</p>
  
  <pre class="lang-dart prettyprint-override"><code>TextFormField(
    controller: barcodeStringController,
    autofocus: true,
    textCapitalization: TextCapitalization.characters,
    style: TextStyle(fontSize: 20),
    textInputAction: TextInputAction.done,
    onFieldSubmitted: (v) =&gt; submit(),
  );
  </code></pre>
  
  <p>Do anyone have experience with something like this?</p>