title: Trigger a validate/submit form method from the AppBar in flutter
body: <p>I have 3 widgets.</p>
  <p>The HomeApp - A stateless Widget that connects everything.<br />
  A custom AppBarWidget - A Stateful Widget which have a submit button.<br />
  A SurveyForm Widget - A Stateful widget which have 50+ inputs including TextFormField, radio buttons, and a whole bunch of custom input types.</p>
  <p>When the user press the submit button in the appbar, it needs to do some custom validations in the survey form, create a new model class. which translate into a JSON object, and get POST to an API.</p>
  <p>I've read a few options,</p>
  <ol>
  <li>Initiate all the variables and the validation/submit logics in the HomeApp, pass it down to the SurveyForm, and use callback to trigger the function. But it involves me passing down 50+ parameters to the SurveyForm.</li>
  <li>Using a GlobalKey. Not really sure how it works, When I try to do <code>final key = new GlobalKey&lt;SurveyForm&gt;();</code>, It said <code>'SurveyForm' doesn't extend 'State&lt;StatefulWidget&gt;'.</code>.</li>
  <li>Pass the parent instance to the child widget, suggested by <a href="https://stackoverflow.com/questions/48481590/how-to-set-update-state-of-statefulwidget-from-other-statefulwidget-in-flutter">this link</a>.</li>
  <li>Calling a method of child widget, but <a href="https://stackoverflow.com/questions/51029655/call-method-in-one-stateful-widget-from-another-stateful-widget-flutter#:%7E:text=Calling%20a%20method%20of%20child,widget%20to%20update%20its%20children.">this link</a> said it's discouraged.</li>
  <li>Write a custom controller.</li>
  </ol>
  <p>What would be the preferable way in Flutter?</p>