title: I have a question about defining a route for moving pages in flutter
body: <p>I tried to define a route for page navigation, but as you can see, the following error occurs.</p>
  <p>What's the difference between the DashBoardMain and MyProfileModify causing this error?<a href="https://i.stack.imgur.com/VYCk0.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>This is the code that is normally defined.</p>
  <pre><code>class DashBoardMain extends StatefulWidget {
    @override
    _DashBoardMainState createState() =&gt; _DashBoardMainState();
  }
  
  class _DashBoardMainState extends State&lt;DashBoardMain&gt; {
    
  
    @override
    void initState() {
      super.initState();
      pageController = PageController();
    }
  
    @override
    void dispose() {
      pageController.dispose();
      super.dispose();
    }
  
    @override
    Widget build(BuildContext context) {
      int _value = 0;
  
      return Scaffold(...);
    }
  }
  
  </code></pre>
  <p>This is the code where the error occurs.</p>
  <pre><code>class MyProfileModify extends StatefulWidget {
    @override
    _MyProfileModifyState createState() =&gt; _MyProfileModifyState();
  }
  
  class _MyProfileModifyState extends State&lt;MyProfileModify&gt; {
  
    void  initState() {
      super.initState();
    }
  
    void dispose() {
      super.dispose();
    }
  
    @override
    Widget build(BuildContext context) {
      Widget submitButton = new Container(
        child: new RaisedButton(
          onPressed: submitData,
          child: new Padding(
            padding: new EdgeInsets.all(16.0),
            child: new Text('Submit Data'),
          ),
        ),
      );
  
      return Scaffold(...);
    }
  }
  
  </code></pre>