pushReplacement method Null safety

dynamic pushReplacement(
  1. {required Widget page}
)

Implementation

pushReplacement({required Widget page}) {
  Navigator.pushReplacement(
      this, MaterialPageRoute(builder: (context) => page));
}