title: Not able to validate mandatory input field widgets in flutter/dart
body: <p>I am trying to validate my user input which contains two input fields "title" and "description" after click on floating action button but I am getting an error when I do that.</p>
  
  <p><strong>notes_detail_widget.dart</strong></p>
  
  <pre><code>class NoteDetailsWidgetState extends State&lt;NoteDetailsWidget&gt; {
    final _formKey = new GlobalKey&lt;FormState&gt;();
    String _title;
    String _description;
  
    _submit() {
      if (_formKey.currentState.validate()) {
        _formKey.currentState.save();
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return new Scaffold(
        appBar: new AppBar(
          title: new Text("Edit note data"),
        ),
        body: new Form(
          child: new Container(
              margin: new EdgeInsets.all(16.0),
              child: new Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: &lt;Widget&gt;[
                    new Container(
                      child: new TextFormField(
                          decoration: new InputDecoration(
                            labelText: "Title",
                            border: InputBorder.none,
                          ),
                          validator: (val) =&gt;
                              val.isNotEmpty ? null : "Title must not be empty",
                          onSaved: (val) =&gt; _title = val),
                    ),
                    new Container(
                        child: new Divider(
                      color: Colors.black,
                    )),
                    new TextFormField(
                      decoration: new InputDecoration(
                        labelText: "Description",
                        border: InputBorder.none,
                      ),
                      keyboardType: TextInputType.multiline,
                      maxLines: 3,
                      validator: (val) =&gt;
                          val.isNotEmpty ? null : "Description must not be empty",
                      onSaved: (val) =&gt; _description = val,
                    )
                  ])),
        ),
        floatingActionButton: new FloatingActionButton(
            onPressed: () =&gt; _submit(), child: new Icon(Icons.check)),
      );
    }
  }
  </code></pre>
  
  <p><strong>Error Log:</strong></p>
  
  <pre><code>I/flutter ( 8055): ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
  I/flutter ( 8055): The following NoSuchMethodError was thrown while handling a gesture:
  I/flutter ( 8055): The method 'validate' was called on null.
  I/flutter ( 8055): Receiver: null
  I/flutter ( 8055): Tried calling: validate()
  I/flutter ( 8055): 
  I/flutter ( 8055): When the exception was thrown, this was the stack:
  I/flutter ( 8055): #0      Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
  I/flutter ( 8055): #1      NoteDetailsWidgetState._submit (package:notes_crud_app/note_details_widget.dart:16:31)
  I/flutter ( 8055): #2      NoteDetailsWidgetState.build.&lt;anonymous closure&gt; (package:notes_crud_app/note_details_widget.dart:61:28)
  I/flutter ( 8055): #3      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:507:14)
  I/flutter ( 8055): #4      _InkResponseState.build.&lt;anonymous closure&gt; (package:flutter/src/material/ink_well.dart:562:30)
  I/flutter ( 8055): #5      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
  I/flutter ( 8055): #6      TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242:9)
  I/flutter ( 8055): #7      TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:175:7)
  I/flutter ( 8055): #8      PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315:9)
  I/flutter ( 8055): #9      PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)
  I/flutter ( 8055): #10     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)
  I/flutter ( 8055): #11     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:180:19)
  I/flutter ( 8055): #12     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:158:22)
  I/flutter ( 8055): #13     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:138:7)
  I/flutter ( 8055): #14     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:101:7)
  I/flutter ( 8055): #15     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:85:7)
  I/flutter ( 8055): #16     _invoke1 (dart:ui/hooks.dart:168:13)
  I/flutter ( 8055): #17     _dispatchPointerDataPacket (dart:ui/hooks.dart:122:5)
  </code></pre>
  
  <p>I am quite new to both <code>Dart</code> and <code>Flutter</code>. Please guide.</p>