title: Flutter: The method 'add' was called on null
body: <p>So I have created a simple notification class as follows:</p>
  
  <pre><code>class NamedNotification{
    String title;
    DateTime scheduledDate;
    int id;
    String description;
  
    NamedNotification(this.scheduledDate, this.id, this.title, this.description);
  }
  </code></pre>
  
  <p>I use this class to keep track of my notifications and add them to a list whenever a new notification is created. I do this like this:</p>
  
  <pre><code>List&lt;NamedNotification&gt; notifications;
  
  onPressed: () {
      setState(() {
          NotificationPlugin newNotification = NotificationPlugin(); 
          newNotification.showAtDayAndTimeNotification(_dateTime, id, title, description);
          NamedNotification listNotification = NamedNotification(_dateTime, id, title, description);
          print(listNotification);
          notifications.add(listNotification);
          id++;
      });
      print(id);
      Navigator.pop(context);
  },
  
  </code></pre>
  
  <p>However, whenever I try to add my namedNotification to the list, I get this error:</p>
  
  <pre><code>The method 'add' was called on null.
  Receiver: null
  Tried calling: add(Instance of 'NamedNotification')
  </code></pre>
  
  <p>I was wondering what the best way was to fix this.</p>