title: I want to validate my textFormField in Flutter without changing the decoration
body: <p>I have a textfield in flutter with border decoration. the text field also have a validator property.My problem is that when i click on submit and the validation error message is shown the text field border goes off.I really don't know any work around about this.</p>
  
  <p>be low is my code:</p>
  
  <pre><code>class _RegisterPageState extends State&lt;RegisterPage&gt; {
    final _key = GlobalKey&lt;FormState&gt;();
    static const textDeco = OutlineInputBorder(
      borderSide: BorderSide(color: Colors.blue),
      borderRadius: BorderRadius.all(
        Radius.circular(25),
      ),
    );
    String _email;
  
    Widget _buildEmail() {
      return TextFormField(
        decoration: InputDecoration(
          // labelText: 'Email',
          enabledBorder: OutlineInputBorder(
            borderSide: BorderSide(color: Colors.transparent),
            borderRadius: BorderRadius.all(
              Radius.circular(25),
            ),
          ),
          focusedBorder: OutlineInputBorder(
            borderSide: BorderSide(color: Colors.blue),
            borderRadius: BorderRadius.all(
              Radius.circular(25),
            ),
          ),
          prefixIcon: Icon(Icons.enhanced_encryption),
          hintText: "Email",
          filled: true,
          fillColor: Colors.grey[200],
        ),
        validator: (String value) {
          if (value.isEmpty) {
            return "Username is required";
          } else if (value.length &lt;= 5) {
            return "Username should be greater than 5";
          } else {
            return null;
          }
        },
        onSaved: (String value) {
          _email = value;
        },
      );
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
          body: Column(
        children: &lt;Widget&gt;[
          Form(
            key: _key,
            child: Padding(
              padding: const EdgeInsets.all(50.0),
              child: Column(
                children: &lt;Widget&gt;[
                  _buildEmail(),
  
                  FlatButton(
                    child: Text("Submit"),
                    onPressed: () {
                      //
                      if (_key.currentState.validate()) {
                        print("sunmitted");
                      }
                    },
                  ),
                ],
              ),
            ),
          )
        ],
      ));
    }
  }
  </code></pre>
  
  <p>and my output looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/vUNR4.png" rel="nofollow noreferrer">Normal interface</a></p>
  
  <p>the error message output looks like this:<a href="https://i.stack.imgur.com/AD7xl.png" rel="nofollow noreferrer">Error interface</a></p>