title: Separate widgets in other files flutter
body: <p>I want to make my code neater but I have a problem when I separate widgets that I use often in 1 file</p>
  
  <p>here is it my main widget</p>
  
  <pre><code>import 'package:a_tiket/Helpers/widget_helper.dart';
  class LoginPage extends StatefulWidget {    
    @override
    _LoginPageState createState() =&gt; _LoginPageState();
  }
  class _LoginPageState extends State&lt;LoginPage&gt; {
  
    bool _isLoading = false;
    var _message = '';
    var _hasError = false;
  
    @override
    Widget build(BuildContext context) {
      return
        _isLoading ?
        _loadingWidget(context)
            :
        Scaffold(
            body: SingleChildScrollView(
                child: Container(
                      ),
                    ],
                  ),
                )
            )
        )
      ;
    }
  }
  </code></pre>
  
  <p>this is my widget_helper.dart</p>
  
  <pre><code>Widget _loadingWidget (BuildContext context){
    return Scaffold(
      body: Center(
        child: CircularProgressIndicator(
          backgroundColor: ACCENT_COLOR,
          valueColor: new AlwaysStoppedAnimation&lt;Color&gt;(PRIMARY_COLOR),
        ),
      ),
    );
  }
  </code></pre>
  
  <p>the problem is i got some error. i have add import for widget_helper but still get error</p>
  
  <pre><code>lib/Pages/loginPage.dart:193:7: Error: The method '_loadingWidget' isn't defined for the class '_LoginPageState'.
  </code></pre>
  
  <p>what should i do? i just want to make the code neater</p>