title: What is wrong with the validation of the form
body: <p>For some reason validation of the form does not work - it allows empty field submitting, what's wrong?</p>
  
  <pre><code>TextFormField(
    validator: (val) {
      if (val.trim().length == 0) {
        return Lang.key(context, 'wrongDeviceName');
      } else {
        return null;
      }
    },
    onSaved: (val) =&gt;
        _name = toBeginningOfSentenceCase(val.trim()),
    initialValue:
        id == 0 ? '' : model.byId(id, tableName).name.toString(),
    keyboardType: TextInputType.visiblePassword,
  ),
  </code></pre>
  
  <p>How can I fix it?</p>