title: Whey do I get error in "snapshot.data.length"
body: <p>I am getting an error with the streambuilder in flutter.
  I'm not sure why I get this error. Please help me out with this problem.</p>
  <pre><code>Widget _galleryGrid() {
  return StreamBuilder(
    stream: imageUrlsController.stream,
    builder: (context, snapshot) {
      if (snapshot.hasData) {
        if (snapshot.data!.length != 0) {
          return GridView.builder(
            gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
            itemCount: snapshot.data!.length,
            itemBuilder: (context, index) {
              return CachedNetworkImage(
                imageUrl: snapshot.data![index],
                fit: BoxFit.cover,
                placeholder: (context, url) =&gt; Container(
                    alignment: Alignment.center,
                    child: CircularProgressIndicator()
                )
              );
            }
          );
        } else {
          return Center(child: Text('No images to display.'));
        }
      } else {
        return Center(child: CircularProgressIndicator());
      }
    }
  );
  </code></pre>
  <p>}</p>
  <p>I have red underline indicating error in 3 parts in total</p>
  <p>if (snapshot.data!.<strong>length</strong> != 0) {</p>
  <p>itemCount: snapshot.data!.<strong>length</strong>,</p>
  <p>imageUrl: snapshot.data![<strong>index</strong>]</p>