title: Singleton destructor in Flutter
body: <p>Once I create a singleton, how do I destruct the code inside it? I have a warning that is presented in the singleton which consumes <code>StreamController</code>, and it requires closing. But there is no method in which I can call the <code>close()</code> function.</p>
  <p>This is the singleton code I have at the moment. <code>StreamController</code> is creating the warning I want to fix.</p>
  <pre><code>class MyService {
    static final MyService _instance = MyService._privateConstructor();
  
    StreamController&lt;List&gt; _streamController = StreamController&lt;List&gt;.broadcast();
  
    factory MyService() =&gt; _instance;
  
    MyService._privateConstructor() {}
  }
  </code></pre>