title: How to show a List with condition in flutter?
body: <p>I have a list that shows all data selected from database. Now I want to implement a condition to select and show data list for the current DateTime only. </p>
  
  <p>Example: show a List where <code>List.year = DateTime().year</code>. </p>
  
  <p>How should I code to make something like that?</p>
  
  <pre><code>class CustomListView extends StatelessWidget {
  
    final List&lt;Spacecraft&gt; spacecrafts;
  
    CustomListView(this.spacecrafts);
  
    Widget build(context) {
  
    return ListView.builder(
  
       itemCount: spacecrafts.length,
  
       itemBuilder: (context, int currentIndex) {
  
        return createViewItem(spacecrafts[currentIndex], context);
  
       },
     ); 
    }
  
     Widget createViewItem(Spacecraft spacecraft, BuildContext context) {
  
          var itemDate = spacecraft.startDate;
          var currentDate =  new DateTime.now() ;
  
          return new ListTile(
                         .....
  </code></pre>