title: Late variable in Dart
body: <p>I'm new to use Websocket in Flutter.</p>
  <p>So I was reading some post (<a href="https://blog.logrocket.com/using-websockets-flutter/" rel="nofollow noreferrer">https://blog.logrocket.com/using-websockets-flutter/</a>) to understand how to use websocket, and I have some question.</p>
  <p>The guy in this post declare _etheWebsocket,_btcWebsocket variables as late as below.</p>
  <pre><code>class CoinbaseProvider {
    late final WebSocketChannel _ethWebsocket;
    late final WebSocketChannel _btcWebsocket;
  
    CoinbaseProvider()
        : _ethWebsocket = WebSocketChannel.connect(
            Uri.parse('wss://ws-feed.pro.coinbase.com'),
          ),
          _btcWebsocket = WebSocketChannel.connect(
            Uri.parse('wss://ws-feed.pro.coinbase.com'),
          );
  </code></pre>
  <p>But why not just declare without late like below??
  What is the reason have to declare WebsocketChannel as late.</p>
  <pre><code>class CoinbaseProvider {
    final WebSocketChannel _ethWebsocket = WebSocketChannel.connect(
      Uri.parse('wss://ws-feed.pro.coinbase.com'),
    );
    final WebSocketChannel _btcWebsocket = WebSocketChannel.connect(
      Uri.parse('wss://ws-feed.pro.coinbase.com'),
    );
  
    CoinbaseProvider();
  </code></pre>