title: How can I show alert dialog on base of a stream in case network request fails
body: <p>Here goes the code I have so far.
  <code>_mBlock.mSpotStream</code> is a network request.
  I am interested how can I show alert dialog in case <code>_mBlock.getSpots()</code> fails with a network error, while keeping list on screen. I have tried returning alert dialog as a widget, but in this case I can't close it.</p>
  <pre><code> @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(title: Text(Strings.of(context).spot_list_title), centerTitle: true),
        body: Container(
            child: Column(
          children: [
            Expanded(
                child: Stack(
              children: [
                StreamBuilder&lt;List&lt;SpotDto&gt;&gt;(
                  stream: _mBlock.mSpotStream,
                  builder: (context, snapshot) {
                    return RefreshIndicator(
                      onRefresh: () {
                        return _mBlock.getSpots();
                      },
                      child: ListView.builder(
                        itemCount: snapshot.data?.length ?? 0,
                        itemBuilder: (context, position) {
                          return SpotListItem(snapshot.data[position], () {
                            ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(position.toString())));
                          });
                        },
                      ),
                    );
                  },
                ),
                Column(
                  children: [
                    Expanded(
                      child: StreamBuilder&lt;Progress&lt;bool&gt;&gt;(
                        stream: _mBlock.mStateStream,
                        builder: (context, snapshot) {
                          return Visibility(
                            visible: snapshot.data?.mIsLoading ?? false,
                            child: SizedBox.expand(
                              child: Container(
                                color: Colors.blue.withOpacity(Dimens.overlayOpacity),
                                child: Center(
                                  child: CircularProgressIndicator(),
                                ),
                              ),
                            ),
                          );
                        },
                      ),
                    )
                  ],
                )
              ],
            ))
          ],
        )),
      );
    }
  }
  
  showAlertDialog(BuildContext context, SpotListBlock block) {
    StreamBuilder&lt;Error&lt;String&gt;&gt;(
      stream: block.mErrorStream,
      builder: (context, snapshot) {
        if (snapshot.hasData) {
          return AlertDialog(
            title: Text(Strings.of(context).error),
            content: Text(snapshot.data.mErrorMessage),
            actions: [
              FlatButton(
                child: Text(&quot;Cancel&quot;),
                onPressed: () {
                  Navigator.pop(context, true);
                },
              )
            ],
          );
        } else {
          return Row();
        }
      },
    );
  }
  </code></pre>