title: How to call widget section from another file in Flutter
body: <p>i have Method and Widget section defined in main.dart and my code works fine,</p>
  
  <p>i created new file method.dart and used all methods in that file and imported methods in my main file and it worked,</p>
  
  <p>but my issue is how i can call Widget section from another file in main.dart.</p>
  
  <p><strong>main.dart:</strong></p>
  
  <blockquote>
    <p>how to call following widget from another file:</p>
  </blockquote>
  
  <pre><code>Widget buttonSection = Container(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: [
            _buildButtonColumn(color, Icons.call, 'CALL'),
            _buildButtonColumn(color, Icons.near_me, 'ROUTE'),
            _buildButtonColumn(color, Icons.share, 'SHARE'),
          ],
        ),
      );
  </code></pre>
  
  <blockquote>
    <p>following method can be called from another file:</p>
  </blockquote>
  
  <pre><code>Column _buildButtonColumn(Color color, IconData icon, String label) {
      return Column(
        mainAxisSize: MainAxisSize.min,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Icon(icon, color: color),
          Container(
            margin: const EdgeInsets.only(top: 8),
            child: Text(
              label,
              style: TextStyle(
                fontSize: 12,
                fontWeight: FontWeight.w400,
                color: color,
              ),
            ),
          ),
        ],
      );
    }
  </code></pre>
  
  <blockquote>
    <p>Using it in material function:</p>
  </blockquote>
  
  <pre><code>return MaterialApp(
        title: 'Flutter layout demo',
        home: Scaffold(
          appBar: AppBar(
            title: Text('Flutter layout demo'),
          ),
          body: ListView(
            children: [
              Image.asset(
                'images/lake.jpg',
                width: 600,
                height: 240,
                fit: BoxFit.cover,
              ),
  
              buttonSection,
  
            ],
          ),
        ),
      );
  </code></pre>