title: Accessing a method of state class using its stateful widget?
body: <p>I have a method in state class, but I need to access that method in outside using its widget class reference,</p>
  
  <pre><code>class TestFormState extends StatefulWidget {
    @override
    State&lt;StatefulWidget&gt; createState() {
      return _testState();
    }
  }
  
  class _testFormState extends State&lt;TestFormState&gt; {
    int count = 1;
  
    @override
    Widget build(BuildContext context) {
      return Center(
          child: Container(
          color: Colors.green,
              child: Text("Count : $count"),
          ),
      );
    }
  
    clickIncrease(){
      setState(() { count += 1; });
    }
  }
  </code></pre>
  
  <p>and I need to access the above widget`s clickIncrease in another widget, like below code, </p>
  
  <pre><code>class TutorialHome extends StatelessWidget {
  
      TestFormState test;
  
    @override
    Widget build(BuildContext context) {
      // Scaffold is a layout for the major Material Components.
      return Scaffold(
        body: Column(
           children: &lt;Widget&gt;[
              test = TestFormState(),
              FlatButton(
                 child: Text("Increase"),
                 onPressed: (){
                    test.state.clickIncrease(); // This kind of thing I need to do
                 },
              ),
           ]
        ),
      );
    }
  </code></pre>
  
  <p>I wrote above code just for demostrate the issue.</p>