Check out example codes for "flutter transition between screens in a streambuilder". It will help you in understanding the concepts better.

Code Example 1

StreamBuilder(
  stream: stream,
  builder: (context, snapshot) {
    return AnimatedSwitcher(
      duration: const Duration(seconds: 4),
      child: snapshot.hasData
        ? Text(snapshot.data)
        : CircularProgressIndicator();
    );
  }
),

Learn ReactJs, React Native from akashmittal.com