pop and push shows black screen which needs to be pressed back flutter

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

Also in C: