title: how to change background color textformfield in flutter when error condition?
body: <p>how to change background color textformfield in flutter when error condition?</p>
  <p>i want to build textfield like this
  <a href="https://i.stack.imgur.com/JHlPJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JHlPJ.png" alt="enter image description here" /></a></p>
  <p>this is my code</p>
  <p>class FormData extends StatefulWidget{</p>
  <p>@override</p>
  <p>FormDataState  createState()  =&gt; FormDataState();</p>
  <p>}</p>
  <p>class FormDataState extends State{</p>
  <pre><code>  final formKey = GlobalKey&lt;FormState&gt;();
  
    TextEditingController _accidentCtrl = TextEditingController();
  
    TextEditingController _passCtrl = TextEditingController();
  
    bool kondisiObscure = true;
  
    bool inputteks  = false;
  
  
   void validateAndSave() {
  final FormState form = formKey.currentState;
  if (form.validate()) {
    inputteks  = false;
  
  } else {
    inputteks  = true;
  
  }
  </code></pre>
  <p>}</p>
  <pre><code>Padding(
                          padding: const EdgeInsets.only(top: 25, right: 25, left: 25),
                          child: Container(
  
                            width: 315,
                            decoration: BoxDecoration(
                              color: Color(0xffF2F3F5),
                              borderRadius: BorderRadius.circular(8),
                            ),
                            child: TextFormField(
  
                              validator: (value) {
                                if (value.isEmpty) {
                                 return 'Harap diisi';
                                }
                                else{
                                  inputteks = false;
  
                                }
                              },
                              textAlign: TextAlign.start,
                              decoration: InputDecoration(
  
                                  fillColor: Color(0xfffaebeb),
                                  filled: inputteks,
                                  contentPadding: EdgeInsets.all(12),
                                  border: InputBorder.none,
                                  focusedBorder: new OutlineInputBorder(
                                    borderRadius: new BorderRadius.circular(10.0),
                                    borderSide:  BorderSide(color: Color(0xff3F8AE0) ),
  
                                  ),
                                  enabledBorder: new OutlineInputBorder(
                                    borderRadius: new BorderRadius.circular(10.0),
                                    borderSide:  BorderSide(color: Colors.black12, width: 1),
                                  ),
                                  errorBorder: new OutlineInputBorder(
                                    borderRadius: new BorderRadius.circular(10.0),
                                    borderSide:  BorderSide(color: Color(0xffE64646) ),
  
                                  ),
                                  disabledBorder: InputBorder.none,),
  
                              autofocus: true,
                              controller: _accidentCtrl,
                              onChanged: (String value) {
                                formProvider.namatext(value);
                                _accidentCtrl.selection = TextSelection.fromPosition(TextPosition(offset: _accidentCtrl.text.length));
                                },
                            ),
                          ),
                        ),
  
   Container(
              width: 200,
              height: 40,
              child: RaisedButton(
                  onPressed: validateAndSave,
                  color: ungu,
                  shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(17),
                    ),
                child: Text(
                  'Submit', style: putihstyle.copyWith(
                    fontSize: 16,),
                  ),
              ),
            ),],
          ),
  
        ),
      ),
  </code></pre>
  <p>is it right or not? because in textfield not showing backgroundcolor</p>