Check out example codes for "pop and push shows black screen which needs to be pressed back flutter". It will help you in understanding the concepts better.

Code Example 1

Navigator.pop(context);
Navigator.push(
            context,
            MaterialPageRoute(builder: (context) => SecondActivity()),
          );

Learn ReactJs, React Native from akashmittal.com