title: Need help in making a reusable widget in flutter
body: <p>So I am making an app with flutter. So in the <em>main.dart</em> file i am making a component which is basically a bunch of widgets wrapped together. I have to use this component multiple times so I thought of making these reusable component in another dart file and then importing it in <em>main.dart</em>.</p>
  
  <p>This is my code for <em>reusable.dart</em></p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  double mainTab = 150;
  
  class TileData extends StatefulWidget {
    @override
    _TileDataState createState() =&gt; _TileDataState();
  }
  
  class _TileDataState extends State&lt;TileData&gt; {
    @override
    Widget build(BuildContext context) {
      return Container(
        height: 200 - 15.0,
        width: mainTab - 10.0,
        child: Padding(
          padding: const EdgeInsets.fromLTRB(10, 15, 0, 0),
          child: Column(
  
          ),
        ),
      );
    }
  }
  </code></pre>
  
  <p>I plan to use this TileData Widget in my <em>main.dart</em> in this manner</p>
  
  <pre><code>
  ListView(
     children: children: &lt;Widget&gt;[
        TileData(
            children: &lt;Widget&gt;[
                 Text('Element 1'),
  ]),
        TileData(
            children: &lt;Widget&gt;[
                 Text('Element 2'),
  ]),
        TileData(
            children: &lt;Widget&gt;[
                 Text('Element 3'),
  ],
  )
  ],
  ),
  </code></pre>
  
  <p>So the children of the TileData() widget are actually the children of the column which was last wrapped in the widget in <em>reusable.dart</em></p>
  
  <p>Is there any way I can achieve this?</p>